public class Test058 extends Super
{
public static void main(
String args[]) {
Test058 t = new Test058();
Super s = (Super)t;
s.method('a');
}
public void method(int i){System.out.println("base int");}
public void method(char c){System.out.println("base char");}
}
class Super
{
public void method(int i){System.out.println("super int");}
public void method(char c){System.out.println("super char");}
}
-----------------------------------------------------------------------
The output is: base char
I'm wondering why casting the variable t to Super doesn't call the the method of the Super class ?