Yes you can. Try this:
public class TestMain {
/**
* @param args
*/
public static final void main(String[] args) {
System.out.println("Inside final mail method...");
}
}
It will print "Inside final mail method..." in the console.
if we declare a method as final then it can be changed.
Declare it final.
Declare the class as final. final class A{ ... }
They are inversely related. That is: If you declare a method as final you cannot overridden in the child class If you declare a class as final you cannot inherit it in any other class.
By using the final keyword in the class declaration statement. Ex: public final class Test {...}
You can declare a class as "final".
You declare a method final in Java when you do not want any subclasses of your class to be able to override the method. I have also heard that this allows the Java compiler to make more intelligent decisions. For example, it supposedly allows Java to decide when to make a method inline. (Note that this is all unconfirmed)
To make laws and declare war
declare our independence from Britain
To make laws and declare war
on June 13 -2010
main character final fantasy tactics : ramza