Looking at the following question:
Question 2)
What will happen when you attempt to compile and run this code?
public class MyMain{
public static void main(
String argv){
System.out.println("Hello cruel world");
}
}
1) The compiler will complain that main is a reserved
word and cannot be used for a class
2) The code will compile and when run will print out "Hello cruel world"
3) The code will compile but will complain at run time that no constructor is defined
4) The code will compile but will complain at run time that main is not correctly defined
...marcus says the correct answer is 4. But when I run it, the code compiles runs and nothing is printed out.
Why doesn't it work as the exam answer says?
Arthur.