Single Choice
Easy
QWhy is the main method declared as static in Java?
ID: #10332
Abstract class and method
171 views
Question Info
#10332Q ID
EasyDifficulty
Abstract class and methodTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer
Explanation
The main method in Java is declared as static so that it can be called without creating an instance of the class. This is because the main method is the entry point of the program and needs to be executed first when the program starts. Additionally, the main method is declared as static so that it can access static variables and methods directly without the need to create an instance of the class.
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic