+ 1
How come the main() method in java is not final?
Usually it is like this in Java: public static void main(String[] args) {} But why not this? public final static void main(String[] args) {} You don't want to override main anyway. So why not make it final?
3 odpowiedzi
+ 22
It can be final though. But then it'll act like a JavaFX framework and you have to add a package called Javafx.application.Application;
P.S It's unsupported in the C.P :)
0
The main reason is that writing "final" is extra work. If you would have to explicitly say both, final or whatever the keyword for the opposite would be, people would likely write final more often.