gs gs111 Inheritance (Using Java) - Hybrid Inheritance - Quiz No.2
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 5 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("C"); } } class Y extends X { public void B() { System.out.println("Python"); } } class Z extends X { public void C() { System.out.println("C++"); } } class V extends Y, Z { public void D() { System.out.println("Java"); } } public class Programming { public static void main(String[] args) { V obj=new V(); obj.A(); obj.B(); obj.C(); obj.D(); } }
C Java C++ Python
Java Python C++ C
C++ Python Java C
class X { public void A() { System.out.println("Superclass"); } } class Y extends X { public void B() { System.out.println("Subclass of X"); } } class Z extends X { public void C() { System.out.println("Subclass of X"); } } class V extends Y { public void D() { System.out.println("Subclass of Y"); } } public class Superclass { public static void main(String[] args) { V obj=new V(); obj.A(); obj.D(); } }
Superclass Subclass of Y
Superclass Subclass of X
Subclass of X Subclass of Y
Superclass Superclass
class X { int a=4,b=8; } class Y extends X { public void B() { System.out.println(Math.pow(a,b)); } } class Z extends X { public void C() { System.out.println(Math.sqrt(a)); } } class V extends Y { public void D() { System.out.println(Math.cbrt(b)); } } public class Operations { public static void main(String[] args) { V obj=new V(); Z obj2=new Z(); obj.B(); obj.D(); obj2.C(); } }
2.0 2.0 2.0
1024.0 2.0 2.0
2.0 4.0 8.0
65536.0 2.0 2.0