0
Can i get any error if i don't declare String args [] in main method
Can i get any error if i don't declare String args [] in main method
3 Réponses
+ 1
you will not get an error in compilation time , but the code will not run. because the Java Virtual Machine looks for a main with (String [] args) in runtime, if it's not found it will stop.
0
You will get an error at only runtime, saying that the main method is not found for the specified class name.
0
Hello Kagupati.Sampath Raja Raghupathi
If you use an IDE like Eclipse you get a message the code don't run without a main method.
Please take a look at the sololearn Tutorials.
Regards kiuziu