Friday, May 12, 2006

static final methods

class A {
public static void isNotFinal() {}
public static final void isFinal() {}
}

class B extends A {
public static void isNotFinal() {} //ok
public static void isFinal() {} //error!
}


It stops you from declaring a static method with the same name and parameter types in a derived class.

0 Comments:

Post a Comment

<< Home