Single, Multilevel & Hierarchical Inheritance in Java

Duration: 14 min

This video lesson is available to enrolled students.

Return to /learn/ASRB-ICAR-T3-T4-INFORMATION-TECHNOLOGY-PRELIMS-MAINS/oops-with-c-java/oops-with-java/inheritance/asset-single-multilevel-hierarchical-inheritance-in-java after enrolling

Inside: a video lesson and guided study material.

Module outline

  1. Prelims: General Knowledge: Physics Chemistry Biology History Geography Polity Indian Economy Static General Knowledge GK- Current Affairs Environment
  2. Prelims: General English: Vocabulary Noun Pronoun Adjectives Preposition Articles Direct and Indirect Speech Tenses Conjunction Subject Verb Agreement (Verb Noun Agreement) Modals Sentence Re-arrangements (Para Jumbles) (Narrative Sequencing) Sentence Correction (Error Correction) Sentence Completion (Fill in the blanks) Comprehension / Reading Comprehension / Unseen Passages (Critical Reasoning) (Paragraph Questions) Cloze Test (Cloze Passage) Verbal Analogy (Word Based Analogy) Sentence Construction Adverb Verb
  3. Prelims: Quantitative Aptitude: Percentage Ratio and Proportion (Ratios) HCF LCM Divisibility Rules Average Sequence and Series (Series) Number System Powers and Exponents (Surds and Indices) Algebra Profit and Loss Simple Interest and Compound Interest Time and Work Pipe and Cistern Speed Time and Distance Mixture and Alligation Mensuration and Geometry Age Problems Partnership Statistics Data Interpretation Arithmetic
  4. Prelims: General Agriculture: Agriculture in India and Tripura Natural Resource Management Fundamentals of Crop Production Horticulture Crop Improvement Crop Protection Social Science
  5. IT Mains: Operating System: Introduction to OS Process Management CPU Scheduling Process Synchronization Threads & Process Creation Deadlock Memory Management Virtual Memory Disc Scheduling File Management Distributed Systems
  6. IT Mains: Computer Networking: Introduction to CN DLL: Access Control DLL: Flow Control DLL: Error Control Data Link Layer - Ethernet Net Layer: IPv4 & Proto Net Layer: IP Addressing Net Layer:Routing Protocol Transport Layer Services TL: Congestion & UDP Application Layer Hardware Basics Network Security
  7. IT Mains: DBMS: Basics of DBMS ER Diagram Relational Model & Functional Dependencies Keys & Integrity Constraints Normalization (1NF - BCNF) Decomposition Properties & 4NF Relational Algebra SQL Relational Calculus Transaction Management Concurrency Control Database Recovery Big Data Systems Database Security & Authorization Enhanced Data Models NoSQL
  8. IT Mains: Software Engineering: Fundamentals of Software Engineering Software Requirements and Quality Assurance Software Design, Estimation and Metrics Software Testing Software Maintenance and Configuration Management
  9. IT Mains: Data Structures & Algorithms: Introduction to DS Array Stack Queue Linked List Tree Graphs Hashing Algorithm Analysis Time Complexity Analysis Sorting Algorithms
  10. IT Mains: OOPS with C++ & Java: C Fundamentals OOPS with C++ Java Fundamentals Array, String, IO & References OOPS with Java Generic & Collections Multithreading File Handling & I/O
  11. IT Mains: Python: Introduction to Python Tokens, Variables, Data Types, I/O Operators & Expressions Control Flow & Looping Collections & Strings Functions & Modules
  12. IT Mains: Website Development: Website, Browser & Services Internet Fundamentals Web Design & Development Protocols & Services Web Publishing & Hosting Server Side & Security Emerging Technologies HTML Basics HTML5 CSS JavaScript-Basics .Net Programming PHP
  13. IT Mains: Mobile App Development: Mobile Computing Multimedia
  14. IT Mains: Linux / Windows Server Admin: Unix OS Linux OS
AI summary & chapters

AI Summary

An AI-generated summary of this video lecture.

This Java lecture introduces single, multilevel, and hierarchical inheritance using slide definitions, syntax templates, and runnable IDE examples. It begins by defining single inheritance as one child class inheriting from one parent class, showing the extends keyword and a Class A to Class B diagram. The instructor then demonstrates a Main.java example where Dog extends Animal, allowing a Dog object to call both the inherited eat() method and its own bark() method, with console output Eating... and Barking.... The lesson progresses to multilevel inheritance through Animal, Dog extends Animal, and Puppy extends Dog, showing that a Puppy object can access methods from all levels. Finally, hierarchical inheritance is defined as multiple child classes inheriting from one parent, illustrated by both Dog and Cat extending Animal, with console output Animal eats, Dog barks, Animal eats, and Cat meows. The final segment revisits the single inheritance slide and code, reinforcing the extends syntax and inheritance chain.

Chapters

  1. 0:00 – 2:00 00:00-02:00

    The opening slide defines single inheritance as a type of inheritance in which one child class inherits from one parent class. It shows syntax with class Base_Class_Name and class Derived_Class_Name extends Base_Class_Name, emphasizing the extends keyword. A two-box diagram places Class A above Class B with an upward arrow, visually representing the parent-child relationship.

  2. 2:00 – 5:00 02:00-05:00

    The instructor moves to a Java IDE example in Main.java. class Animal defines void eat() printing Eating..., while class Dog extends Animal defines void bark() printing Barking.... The main method creates Dog d = new Dog(); and calls d.eat(); and d.bark();. The console displays Eating... and Barking..., demonstrating that the Dog object can use both the inherited method and its own method.

  3. 5:00 – 10:00 05:00-10:00

    The lecture transitions to multilevel and hierarchical inheritance. A code example shows class Animal, class Dog extends Animal, and class Puppy extends Dog. A Puppy object calls p.eat();, p.bark();, and p.play();, producing Animal eats, Dog barks, and Puppy plays. A slide then defines hierarchical inheritance as multiple child classes inheriting from a single parent class, with a diagram showing Class A branching to Class B, Class C, and Class D.

  4. 10:00 – 14:09 10:00-14:09

    The final segment demonstrates hierarchical inheritance with class Animal, class Dog extends Animal, and class Cat extends Animal. The main method creates Dog and Cat objects and calls their methods, producing console output Animal eats, Dog barks, Animal eats, and Cat meows. The instructor returns to the single inheritance slide, again highlighting the extends keyword in the syntax block and the Class A to Class B diagram.

The lecture builds a clear progression from basic to complex inheritance patterns. Single inheritance is established first with a simple two-class relationship and the extends keyword. The Animal-Dog example makes the concept concrete by showing method access through an object. Multilevel inheritance extends this chain to three classes, demonstrating that inheritance is transitive. Hierarchical inheritance then shows one parent with multiple children, using the Animal-Dog-Cat example to prove that each child independently inherits the parent's methods. The repeated use of console output and red annotations helps students connect code structure to runtime behavior.

Loading lesson…