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

Ads









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?
Should a main method be compulsorily declared in all java classes?
Can a method inside a Interface be declared as final?
Can a method inside a Interface be declared as final?
Can a main method be overloaded?
main method
main method
Can a class be declared as protected?
main() method
Can a class be declared as static?
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?
Can a abstract class be declared final?
When is java main method called?
What is the first argument of the String array in main() method?
ModuleNotFoundError: No module named 'nester_al_ali_finall'
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
Why servletcontainer can,t call the Init() method ?
can we inherit static method in java?
Java Method Return Value
Can we declare a static variable inside a method?
ModuleNotFoundError: No module named 'declared'
ModuleNotFoundError: No module named 'declared'
Can we replace main() with static block or with other static methods?
Method overriding
public static void main
method
method
Method Overriding in Java
Declaring Method in Objective C
pack() vs. setSize() Method in Java
Finalize Method in Java

Ads