1)final methods can not be visible to the childs classes-->WRONG.
final methods are visible in the subclass as below code shows.
class Parent {
static final void f() {System.out.println("parent");} // line (1)
}
class Child19of46 extends Parent {
//static final void f(){System.out.println("Child");} // line (2)
public static void main(
String args[]){
Parent p = new Child19of46();
p.f();
}
}
2)declaring method as final(instance/static) in superclass implies
a)instance method in superclass can not be overriden in subclass.
b)static method in superclass can not be hidden in subclass.
3)Method declare at line 1 is final.. At line 2, its a totally different method, its not overriden becoz of static declaration at line 1.
a)This is the case for private methods.
b)Method at line (2) is not a totally different method.
4)You are getting compile time error because you are trying to hide static final method in superclass.
[ May 15, 2006: Message edited by: Girish Nagaraj ]
[ May 15, 2006: Message edited by: Girish Nagaraj ]