+ 2

can we declare the main method as final?

23rd Aug 2016, 9:43 PM
kelvin kosgei
kelvin kosgei - avatar
4 Answers
+ 1
i meant so that it cannot be overridden
24th Aug 2016, 7:42 AM
kelvin kosgei
kelvin kosgei - avatar
0
No. JVM wouldn't be able to locate the main method if it's not public since the JVM is outside the default package.
24th Aug 2016, 12:10 AM
James
James - avatar
0
What I said still stands, no FINAL on main.main method can not be overridden either. It is static after all.
24th Aug 2016, 8:24 AM
James
James - avatar
0
no
24th Aug 2016, 11:20 AM
shridhar metraskar
shridhar metraskar - avatar