public class Test {
public static void main(String[] args) {
Son s = new Son();
Parent p = (Parent)s;
p.print();
//p.foo();
}
}
class Parent{
void print(){
System.out.println("parent print");
}
}
class Son extends Parent{
void print(){
System.out.println("son print");
}
void foo(){
System.out.println("son foo()");
}
}