Hi,all
The following description:
A final method cannot be overridden in a subclass. This is discussed in the lesson on interfaces and inheritance. Here is an example of using a final method for initializing an instance variable: class Whatever {
    private varType myVar = initializeInstanceVariable();

    protected final varType initializeInstanceVariable() {        //initialization code goes here
    }
}
This is especially useful if subclasses might want to reuse the initialization method. The method is final because calling non-final methods during instance initialization can cause problems.-And my questions as follows:
1.Since the final method cannot be overridden, how to reuse.
2.Why choose final method, what can we benefit from final method.
3.I will try whether it's OK when I use a non-final method to initialization.Best wishes.

解决方案 »

  1.   

    1.This is especially useful if subclasses might want to reuse the initialization method.你理解的不对。这句话的意思是使用final在防止子类冲用初始化方法的时候特别有用。
    2,3.父类初始化时调用子类的方法是很不好的,具体看effective java
      

  2.   

    answers for you
    1. Not all method are intended to be reuse。 If the function of a method is just to fullfill tasks available by its class only,why the subclass will reuse it?
    2.  a. More clear method group.
        b.encapsulated reason.
    3. I don't know what's your meaning