Java Coder
Can a main method be declared final?
1 Answer(s)      2 years and 5 months ago
Posted in : Java Beginners

Hi,

Can a main method be declared final?

Thanks

Advertisement
View Answers

April 11, 2013 at 12:13 PM


Hi,

Yes we can. The final method can be declare as follows:

public final String convertCurrency()

The final method can't be override in a subclass.

for more about main method be declared final in Java