What will happen when you attempt to compile and run this code?
public class Mod{
public static void main(
String argv[]){
}
public static native void amethod();
}
1) Error at compilation: native method cannot be static
2) Error at compilation native method must return value
3) Compilation but error at run time unless you have made code containing native amethod available
4) Compilation and execution without error.
Now the problem is when i am compiling this code,an error is generated by the name "Illegal start of expression"...
But this option is not given in the Question's answer options....
Another doubt is that whether a function can be declared in the main?
As far as i know, a function should not be defined in the main but it can be called in the main only...
So, Please.... justify this question...
Thanks..
this code is the 7th question in the following link..
http://www.jchq.net/mockexams/exam2.htm