Is it possible to access the child class method from parent class?
public class C1 {
public C1(){
System.out.println("Constructor C1");
}
}
public class C2 extends C1{
public void m1(){
System.out.println("print from m1");
}
}
public class C3 extends C1{
public void m2(){
System.out.println("print from m2");
}
}
public class TestMain{
public static void main(String[] args){
C1 c1 = new C1();
}
}
Is there anyway to access c1.m1() & c1.m2() without initializing for child class?