InterviewSolution
Saved Bookmarks
| 1. |
What is the purpose of main function in Java? |
|
Answer» From version JDK6 onwards, the MAIN method is mandatory to START code execution. If your program does not contain "main" method, you will get a run-time error. PLEASE note that in the absence of "main" method your entire program will SUCCESSFULLY COMPILE but it will throw an error at runtime. |
|