class InheritanceTest{ public static void main(String[] args){ System.out.print("\n"); /* Test of constructor methods */ Base b1 = new Base(); Base b2 = new Base(3); Sub s1 = new Sub(); Sub s2 = new Sub(4); System.out.print("\n"); /* Test of instance methods */ b1.applyMethod(); s1.applyMethod(); b1 = s1; b1.applyMethod(); s1.applyMethod(); System.out.print("\n"); } }