Can you override the main method in Java?
I'll answer
Earn 20 gold coins for an accepted answer.20
Earn 20 gold coins for an accepted answer.
40more
40more
Works at the European Space Agency, Lives in Paris, France.
We can not override the static method because static metod is a class method and the scope of this method within the same class itself. ... Hence, it does not makes sense to "override" it (or for that matter any static method). The concept of "overriding" is only for instance methods.
2023-05-11 12:30:24
评论(499)
Helpful(122)
Helpful
Helpful(2)

Ethan Reed
QuesHub.com delivers expert answers and knowledge to you.
We can not override the static method because static metod is a class method and the scope of this method within the same class itself. ... Hence, it does not makes sense to "override" it (or for that matter any static method). The concept of "overriding" is only for instance methods.