Can a main method be declared final?

Can a main method be declared final?

Hi,

Can a main method be declared final?

Thanks

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









Related Tutorials/Questions & Answers:
Can a main method be declared final?
Why is the main method declared static?
Advertisements
What if the main() method is declared as private?
Can a method inside a Interface be declared as final?
Can a method inside a Interface be declared as final?
Should a main method be compulsorily declared in all java classes?
Can a main method be overloaded?
main method
main method
main method
Can a class be declared as protected?
main method
main() method
Can a class be declared as static?
Main method overloading
Can a abstract class be declared final?
Is main method compulsory in Java?
What is the return type of the main method?
java sleep in main method
java sleep in main method
What is the arguement of main method?
When is java main method called?
ModuleNotFoundError: No module named 'nester_al_ali_finall'
What is the first argument of the String array in main() method?
Till Slip Program Error Free - No Main Method
Till Slip Program Error Free - No Main Method
Till Slip Program Error Free - No Main Method
Till Slip Program Error Free - No Main Method
Till Slip Program Error Free - No Main Method
Till Slip Program Error Free - No Main Method
Accessing non-static members through the main method in Java.
Why we should use string args[] in main method in java?
Can I have multiple main() methods in the same class?
What is Public static void main
how to open one Jframe from main method call
JAVA what is different between static block and public static void main(String a[]) method
How can print integer in method
JavaScript array push() method
can we inherit static method in java?
Why servletcontainer can,t call the Init() method ?
Java Method Return Value
ModuleNotFoundError: No module named 'declared'
ModuleNotFoundError: No module named 'declared'
Can we declare a static variable inside a method?
Can we replace main() with static block or with other static methods?
can we write a method in JSP - JSP-Servlet
HttpServlet is declared abstract
Method overriding
can i estimate estimate execution time for a method without knowing implementation details of a method - Java Interview Questions
public static void main

Ads