Google News
logo
Java - Interview Questions
What happens if String args[] is not written in main() method?
When main() method is written without String args[] as :
 public static void main()
The code will compile but JVM cannot run the code because it cannot recognize the main() method as the method from where it should start execution of the java program. 

Remember JVM always looks for main() method with string type array as parameter.
Advertisement