Interview Questions - Java Basics
13.
What if I write static public void instead of public static void?
Program compiles and runs properly.
14.
What if I do not provide the String array as the argument to the method?
Program compiles but throws a runtime error "NoSuchMethodError".
15.
What is the first argument of the String array in main() method?
The String array is empty. It does not have any element. This is unlike C/C++ where the first element by default is the program name.
16.
If I do not provide any arguments on the command line, then the String array of main() method will be empty or null?
It is empty. But not null.
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers