class A { public void process() throws Exception{ System.out.print("A "); }} public class B extends A {public void process() { System.out.println("In B"); } public static void main(
String[] args) { A a=new B(); a.process();}}
-----
Hi , the above code is wrong
becasue A is Super class and not is a subclass
It is only applicable B a = new A();
not as A a = new B()
B is low level Hierarchy , A is high level Hierarchy.
Check and tell me your feedback.
Regards
k.krishnamoorthy.