Java Programming - Language Fundamentals - Discussion
|
|
|
|
Read more:"Time and tide wait for none."
- Alexander Pope
|
| 4. |
Which is a reserved word in the Java programming language? |
| [A]. |
method | [B]. |
native | | [C]. |
subclasses | [D]. |
reference | | [E]. |
array |
Answer: Option E
Explanation:
The word "native" is a valid keyword, used to modify a method declaration.
Option A, D and E are not keywords. Option C is wrong because the keyword for subclassing in Java is extends, not 'subclasses'.
|
|
Disha said:
(Fri, Oct 1, 2010 08:50:22 PM)
|
|
| |
| Hey, could you please give an example of using "native" keyword?. |
|
Ijaz said:
(Sun, Feb 27, 2011 11:15:49 PM)
|
|
| |
| I want simple program for 'native' keyword? |
|
Shubhrendu said:
(Tue, Mar 22, 2011 06:24:36 AM)
|
|
| |
Its the example of native method............
import java.util.*;
class ReadFile {
//Native method declaration
native byte[] loadFile(String name);
//Load the library
static {
System.loadLibrary("nativelib");
}
public static void main(String args[]) {
byte buf[];
//Create class instance
ReadFile mappedFile=new ReadFile();
//Call native method to load ReadFile.java
buf=mappedFile.loadFile("ReadFile.java");
//Print contents of ReadFile.java
for(int i=0;i<buf.length;i++) {
System.out.print((char)buf[i]);
}
}
} |
|
Kathirozhi said:
(Mon, Sep 19, 2011 01:21:25 PM)
|
|
| |
Program cannot be run write by Shubhrendu.
please tell the output of that program. |
|
Vishal Kumar Singh said:
(Wed, May 9, 2012 03:32:03 AM)
|
|
| |
| When we can modify the method declaration using "native" keyword in java ? |
|
|