Is it not possible to invoke superclass method?

Viewed 253

Assume that class A extends class B, which extends class C. Also all the three classes implement the method test(). How can a method in class A invoke the test()method defined in class C?

Answer is "It is not possible to invoke test()".

class C {
  
    public static void test(){
        System.out.println("IMESH ISURANGA");
    }
}
  
class B extends C {
  
}

class A extends B {
  //how prove it
}
  
class Demo {
  
    public static void main(String[] args) {
  
        //----
        
    }
}

How to prove it?

0 Answers
Related