Inheritance: 38 MCQs
All 38 multiple-choice questions from this kit, free and with no sign-up.
Warm-up · 20 questions
Q1. Inheritance માં 'is-a' સંબંધનો અર્થ શું છે?
BeginnerAnswers and explanations are in the Veda app.
Q2. નીચેનામાંથી કયો Inheritance નો પ્રકાર નથી?
BeginnerAnswers and explanations are in the Veda app.
Q3. Child class parent class ના કયા members ને વારસામાં મેળવી શકતો નથી?
BeginnerAnswers and explanations are in the Veda app.
Q4. નીચેનામાંથી કયો સંબંધ Inheritance માટે યોગ્ય છે?
BeginnerAnswers and explanations are in the Veda app.
Q5. Multilevel Inheritance માં કેટલા levels હોઈ શકે છે?
BeginnerAnswers and explanations are in the Veda app.
Q6. Java ભાષા Multiple Inheritance ને કેવી રીતે સપોર્ટ કરે છે?
BeginnerAnswers and explanations are in the Veda app.
Q7. Inheritance નો ઉપયોગ કરતી વખતે સૌથી મહત્વપૂર્ણ શું છે?
BeginnerAnswers and explanations are in the Veda app.
Q8. નીચેનામાંથી કયું વિધાન Inheritance વિશે સાચું છે?
BeginnerAnswers and explanations are in the Veda app.
Q9. જો 'Vehicle' parent class છે અને 'Car', 'Bike', 'Truck' child classes છે, તો આ કયા પ્રકારનો Inheritance છે?
BeginnerAnswers and explanations are in the Veda app.
Q10. Inheritance નો ઉપયોગ કરીને તમે શું પ્રાપ્ત કરી શકો છો?
BeginnerAnswers and explanations are in the Veda app.
Q11. ખૂબ ઊંડી inheritance hierarchy ની શું સમસ્યા છે?
BeginnerAnswers and explanations are in the Veda app.
Q12. Inheritance ફક્ત code reusability માટે ઉપયોગી છે.
BeginnerAnswers and explanations are in the Veda app.
Q13. Child class parent class ના private members ને વારસામાં મેળવી શકે છે.
BeginnerAnswers and explanations are in the Veda app.
Q15. Parent class અને Child class વચ્ચે શું સંબંધ છે?
BeginnerAnswers and explanations are in the Veda app.
Q18. Hierarchical Inheritance નું ઉદાહરણ આપો.
BeginnerAnswers and explanations are in the Veda app.
Q20. Child class parent class ના કયા members ને વારસામાં મેળવી શકતો નથી?
BeginnerAnswers and explanations are in the Veda app.
Building up · 11 questions
Q21. Multiple Inheritance શું છે? તેની મર્યાદા શું છે?
IntermediateAnswers and explanations are in the Veda app.
Q22. Inheritance અને Composition વચ્ચે શું તફાવત છે?
IntermediateAnswers and explanations are in the Veda app.
Q23. GUI Frameworks માં Inheritance નો ઉપયોગ કેવી રીતે થાય છે?
IntermediateAnswers and explanations are in the Veda app.
Q24. Polymorphism સાથે Inheritance નો શું સંબંધ છે?
IntermediateAnswers and explanations are in the Veda app.
Q25. Game Development માં Inheritance નો ઉપયોગ કેવી રીતે થાય છે?
IntermediateAnswers and explanations are in the Veda app.
Q26. Data Structures માં Inheritance નો ઉપયોગ કેવી રીતે થાય છે?
IntermediateAnswers and explanations are in the Veda app.
Q27. નીચેનામાંથી કયો સંબંધ Inheritance (વારસા) માટે સૌથી યોગ્ય છે?
IntermediateAnswers and explanations are in the Veda app.
Q28. જો Parent Class 'Vehicle' (વાહન) માં 'startEngine()' અને 'stopEngine()' methods છે, અને Child Class 'Car' (કાર) માં 'openTrunk()' method ઉમેરવામાં આવે છે, તો 'Car' class ના ઑબ્જેક્ટ પર નીચેનામાંથી કઈ method કૉલ કરી શકાય છે?
IntermediateAnswers and explanations are in the Veda app.
Q29. Multilevel Inheritance માં, જો 'Vehicle' → 'Car' → 'SportsCar' એક hierarchy છે, તો 'SportsCar' class ના ઑબ્જેક્ટને કયા class(es) ના members મળે છે?
IntermediateAnswers and explanations are in the Veda app.
Q30. નીચેનામાંથી કયું વિધાન Inheritance (વારસા) ના ઉપયોગ વિશે સાચું છે?
IntermediateAnswers and explanations are in the Veda app.
Q31. જો 'Vehicle' parent class છે અને 'Car', 'Bike', 'Truck' એ બધા 'Vehicle' ના child classes છે, તો આ કયા પ્રકારનો Inheritance છે?
IntermediateAnswers and explanations are in the Veda app.
Topper level · 7 questions
Q32. Inheritance નો ઉપયોગ કરતી વખતે શું ધ્યાન રાખવું જોઈએ?
AdvancedAnswers and explanations are in the Veda app.
Q34. ધારો કે તમારી પાસે નીચેનો Java code છે: ```java class Animal { protected String sound = "Generic sound"; public void makeSound() { System.out.println(sound); } } class Dog extends Animal { private String sound = "Bark"; @Override public void makeSound() { System.out.println(sound); } } public class Test { public static void main(String[] args) { Animal a = new Dog(); a.makeSound(); } } ``` આ code નું આઉટપુટ શું હશે?
AdvancedAnswers and explanations are in the Veda app.
Q35. નીચેના Java code ને ધ્યાનમાં લો: ```java class A { int x = 10; void display() { System.out.println("Class A: " + x); } } class B extends A { int x = 20; void display() { System.out.println("Class B: " + x); } } class C extends B { int x = 30; void display() { System.out.println("Class C: " + x); } } public class Main { public static void main(String[] args) { A obj = new C(); System.out.println(obj.x); obj.display(); } } ``` આ code નું આઉટપુટ શું હશે?
AdvancedAnswers and explanations are in the Veda app.
Q36. ધારો કે તમારી પાસે નીચેનો Java code છે: ```java class Parent { public static void greet() { System.out.println("Hello from Parent"); } public void instanceMethod() { System.out.println("Parent instance"); } } class Child extends Parent { public static void greet() { System.out.println("Hello from Child"); } @Override public void instanceMethod() { System.out.println("Child instance"); } } public class Test { public static void main(String[] args) { Parent p = new Child(); p.greet(); p.instanceMethod(); } } ``` આ code નું આઉટપુટ શું હશે?
AdvancedAnswers and explanations are in the Veda app.
Q37. નીચેના Java code ને ધ્યાનમાં લો: ```java class Base { private int value = 10; public int getValue() { return value; } } class Derived extends Base { private int value = 20; public int getValue() { return value; } public int getBaseValue() { return super.getValue(); } } public class Test { public static void main(String[] args) { Derived d = new Derived(); System.out.println(d.getValue()); System.out.println(d.getBaseValue()); } } ``` આ code નું આઉટપુટ શું હશે?
AdvancedAnswers and explanations are in the Veda app.
Q38. ધારો કે તમારી પાસે નીચેનો Java code છે: ```java interface A { default void show() { System.out.println("A"); } } interface B { default void show() { System.out.println("B"); } } class C implements A, B { public void show() { A.super.show(); B.super.show(); System.out.println("C"); } } public class Test { public static void main(String[] args) { C obj = new C(); obj.show(); } } ``` આ code નું આઉટપુટ શું હશે?
AdvancedAnswers and explanations are in the Veda app.
Your notes can be a kit like these
Every kit here was made from real study material. Point Veda at a chapter, a PDF, a photo or a link and get notes, flashcards, practice MCQs, games and a scored test — free to start, in more than 40 languages.
- Chapter notes
- Flashcards
- Practice MCQs
- Scored tests
- Paper Solver
Get Veda free See what students get
Free to start · Android app and web · More than 40 languages