Over 10 years we helping companies reach their financial and branding goals. Onum is a values-driven SEO agency dedicated.

CONTACTS
ECET 2026 CSE

Day 36 – Night Session: Java – Inheritance (Single, Multilevel) – ECET 2026

In Java OOP (Object-Oriented Programming), Inheritance is one of the most important concepts. It allows one class to acquire the properties and behaviors of another, reducing code duplication and improving reusability.


📘 Concept Notes

🔑 What is Inheritance?

  • Inheritance is the process where one class (child/subclass) derives properties and methods from another class (parent/superclass).
  • Symbolically:

 \text{Child Class} ; \longleftarrow ; \text{Parent Class}


⚙️ Types of Inheritance in Java (ECET Focus)

  1. Single Inheritance
    • One child class inherits from one parent class.
    • Example:
class Animal {
    void eat() { System.out.println("Eating..."); }
}
class Dog extends Animal {
    void bark() { System.out.println("Barking..."); }
}
public class TestSingle {
    public static void main(String[] args) {
        Dog d = new Dog();
        d.eat();   // Inherited from Animal
        d.bark();  // Own method
    }
}
  1. Multilevel Inheritance
    • A class inherits from another class, and then another class inherits from it.Example:
class Animal {
    void eat() { System.out.println("Eating..."); }
}
class Dog extends Animal {
    void bark() { System.out.println("Barking..."); }
}
class Puppy extends Dog {
    void weep() { System.out.println("Weeping..."); }
}
public class TestMultilevel {
    public static void main(String[] args) {
        Puppy p = new Puppy();
        p.eat();   // From Animal
        p.bark();  // From Dog
        p.weep();  // From Puppy
    }
}

📐 Formula – Class Relationship

If  A \rightarrow B means “Class B inherits Class A”, then:

  • Single Inheritance:  A \rightarrow B
  • Multilevel Inheritance:  A \rightarrow B \rightarrow C

🛠 Advantages of Inheritance

  • Code reusability.
  • Method overriding and polymorphism support.
  • Easier maintenance and reduced redundancy.

🔟 10 Expected MCQs – ECET 2026

Q1. Inheritance in Java is achieved using keyword:
A) inherit
B) extends
C) implements
D) super

Q2. In single inheritance, how many parent classes are directly involved?
A) 1
B) 2
C) 3
D) Unlimited

Q3. In multilevel inheritance, class C inherits properties from:
A) Only class A
B) Only class B
C) Both A and B
D) None

Q4. Which of the following is NOT true about inheritance?
A) Reduces redundancy
B) Provides reusability
C) Makes maintenance difficult
D) Supports method overriding

Q5. Symbolically, single inheritance can be represented as:
A)  A \rightarrow B \rightarrow C
B)  A \rightarrow B
C)  B \rightarrow A \rightarrow C
D) None

Q6. Which inheritance type is not supported directly in Java (but via interfaces)?
A) Single
B) Multilevel
C) Multiple
D) Hierarchical

Q7. Which keyword is used to call parent class methods inside child class?
A) this
B) super
C) parent
D) base

Q8. If class C extends class B, and class B extends class A, this is:
A) Multiple inheritance
B) Multilevel inheritance
C) Hierarchical inheritance
D) None

Q9. The main advantage of inheritance is:
A) Increased redundancy
B) Reusability
C) More memory usage
D) None

Q10. In Java, constructors of parent class are:
A) Not inherited
B) Automatically invoked when subclass is created
C) Must be explicitly called
D) None


✅ Answer Key

Q.NoAnswer
Q1B
Q2A
Q3C
Q4C
Q5B
Q6C
Q7B
Q8B
Q9B
Q10B

🧠 Explanations

  • Q1 → B: Inheritance uses extends.
  • Q2 → A: Only one parent class in single inheritance.
  • Q3 → C: In multilevel, C inherits both A and B indirectly.
  • Q4 → C: Inheritance simplifies maintenance.
  • Q5 → B: Single inheritance: A → B.
  • Q6 → C: Multiple inheritance is not supported by classes in Java.
  • Q7 → B: super is used for parent access.
  • Q8 → B: A → B → C = multilevel.
  • Q9 → B: Inheritance allows reusability.
  • Q10 → B: Parent constructor invoked automatically.

🎯 Why Practice Matters

  • Inheritance is a core Java OOP topic.
  • ECET exams test basic code snippets and definitions.
  • With practice, 2–3 marks are guaranteed.

📲 Join Our ECET Prep Community on WhatsApp

👉 Join WhatsApp Group – Click Here

Leave a comment

Your email address will not be published. Required fields are marked *