gs gs111 Inheritance (Using Java) - Hybrid Inheritance - Quiz No.1
gs gs111 OOP Object Oriented Programming Java Quiz
This quiz belongs to book/course code gs gs111 OOP Object Oriented Programming Java of gs organization. We have 178 quizzes available related to the book/course OOP Object Oriented Programming Java. This quiz has a total of 10 multiple choice questions (MCQs) to prepare and belongs to topic Inheritance (Using Java). NVAEducation wants its users to help them learn in an easy way. For that purpose, you are free to prepare online MCQs and quizzes.
NVAEducation also facilitates users to contribute in online competitions with other students to make a challenging situation to learn in a creative way. You can create one to one, and group competition on an topic of a book/course code. Also on NVAEducation you can get certifications by passing the online quiz test.
class X { public void A() { System.out.println("Bangalore"); } } class Y extends X { public void B() { System.out.println("Delhi"); } } class Z extends X { public void C() { System.out.println("Kolkata"); } } class V extends Y { public void D() { System.out.println("Chennai"); } } public class Cities { public static void main(String[] args) { V obj=new V(); Z obj2=new Z(); obj.A(); obj2.A(); } }
Bangalore Bangalore
Bangalore Delhi
Delhi Chennai
Kolkata Chennai
class X { public void A() { System.out.println("India-New Delhi"); } } class Y extends X { public void B() { System.out.println("USA-Washington, D.C."); } } class Z extends X { public void C() { System.out.println("England-London"); } } class V extends Y { public void D() { System.out.println("Australia-Canberra"); } } public class Capitals { public static void main(String[] args) { V obj=new V(); Z obj2=new Z(); obj.A(); obj.D(); obj2.C(); } }
India-New Delhi Australia-Canberra England-London
India-New Delhi USA-Washington, D.C. England-London
USA-Washington, D.C. Australia-Canberra India-New Delhi
Australia-Canberra India-New Delhi USA-Washington, D.C.
class X { public void A() { System.out.println("Living"); } } class Y extends X { public void B() { System.out.println("Humans"); } } class Z extends X { public void C() { System.out.println("Animals"); } } class V extends Z { public void D() { System.out.println("Dog"); } } public class Pets { public static void main(String[] args) { V obj=new V(); Z obj2=new Z(); obj.A(); obj2.C(); obj.D(); } }
Living Animals Dog
Living Humans Dog
Animals Living Dog
Dog Humans Animals
class X { public void A() { System.out.println("Hybrid Inheritance"); } } class Y extends X { public void B() { System.out.println("Single Inheritance"); } } class Z extends X { public void C() { System.out.println("Hierarchical Inheritance"); } } class V extends Z { public void D() { System.out.println("Multilevel Inheritance"); } } public class Inheritance1 { public static void main(String[] args) { V obj=new V(); obj.A(); } }