Polymorphism and its types in Java
Duration: 20 min
This video lesson is available to enrolled students.
Inside: a video lesson and guided study material.
Module outline
- Prelims: General Knowledge: Physics Chemistry Biology History Geography Polity Indian Economy Static General Knowledge GK- Current Affairs Environment
- 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
- 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
- Prelims: General Agriculture: Agriculture in India and Tripura Natural Resource Management Fundamentals of Crop Production Horticulture Crop Improvement Crop Protection Social Science
- 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
- 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
- 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
- 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
- IT Mains: Data Structures & Algorithms: Introduction to DS Array Stack Queue Linked List Tree Graphs Hashing Algorithm Analysis Time Complexity Analysis Sorting Algorithms
- 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
- IT Mains: Python: Introduction to Python Tokens, Variables, Data Types, I/O Operators & Expressions Control Flow & Looping Collections & Strings Functions & Modules
- 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
- IT Mains: Mobile App Development: Mobile Computing Multimedia
- IT Mains: Linux / Windows Server Admin: Unix OS Linux OS
AI summary & chapters
AI Summary
An AI-generated summary of this video lecture.
This lecture introduces polymorphism in Java, defining it as “one interface, many forms” and dividing it into compile-time (static) and run-time (dynamic) polymorphism. The instructor uses a flowchart to show that compile-time polymorphism is achieved through method overloading, while run-time polymorphism is achieved through method overriding. The first half focuses on method overloading, using a Calculator class example with overloaded add methods that differ by parameter count, type, and order. The console output “30 60 31.0” demonstrates how the compiler selects the correct method at compile time. The second half shifts to run-time polymorphism, also called dynamic polymorphism or late binding, and explains the rules for method overriding: same method name, same parameter list, and same or covariant return type. A code example with Animal and Dog classes shows that when a parent reference points to a child object, the child’s overridden method is executed at runtime, producing output such as “Dog barks.”
Chapters
0:00 – 2:00 00:00-02:00
The lecture opens with the title slide “OOPS with Java” and the subtitle “Polymorphism.” The instructor hand-annotates the word “Polymorphism” by underlining “many” and “form,” emphasizing the etymology of the term. The first content slide states that polymorphism means “one interface, many forms” and lists two types: “Compile-Time Polymorphism (Static Polymorphism)” and “Run-Time Polymorphism (Dynamic Polymorphism).” A flowchart appears with a top “Polymorphism” box splitting into a green “Compile-Time” box leading to “Method Overloading” and a pink “Run-Time” box leading to “Method Overriding.” Red marker cues, including a checkmark and circles around “Run-Time” and “Method Overriding,” accumulate as the instructor explains the two branches.
2:00 – 5:00 02:00-05:00
The slide continues with the definition “Polymorphism means ‘one interface, many forms’” and adds that “In Java, the same method call can produce different behavior depending on the situation.” The numbered list of the two polymorphism types remains visible. The flowchart is now color-coded: a blue “Polymorphism” box splits into a green “Compile-Time” box leading to a yellow “Method Overloading” box, and a pink “Run-Time” box leading to a purple “Method Overriding” box. In the top-right, the instructor hand-draws a red sketch of two boxes labeled “A” and “B” with “fun()” annotations, then adds the code “A a = new B();” and “a.fun();” with arrows linking them, illustrating how a parent-type reference can hold a child object and invoke an overridden method.
5:00 – 10:00 05:00-10:00
The lecture transitions to compile-time polymorphism. The slide titled “Compile time Polymorphism” highlights “Method Overloading” and “same name” with red circles. The instructor explains that method overloading means defining multiple methods with the same name but different parameter lists. A code panel shows a Calculator class with overloaded add methods and a Main class that calls them. Red arrows link each call in Main.java to the matching overloaded method in Calculator.java, demonstrating selection based on parameter number, type, and order. The console output “30 60 31.0” confirms the results of the three calls, and the slide notes “Static Binding” as the mechanism by which the compiler resolves the correct method at compile time.
10:00 – 15:00 10:00-15:00
The first part of this window continues the compile-time polymorphism example, with the Calculator.java / Main.java code panel and the console reading “30 60 31.0” still visible. Red arrows connect the overloaded add methods (int; int,int,int; double,double) to the matching calls in Main.java, reinforcing how the compiler chooses the method based on the argument list. The slide then switches to “Run time Polymorphism,” introducing bullets on method overriding, “Dynamic Polymorphism / Late Binding,” and a section headed “Important Rules for Method Overriding.” The instructor begins outlining the conditions that an overriding method must satisfy, setting up the detailed rules that follow.
15:00 – 19:40 15:00-19:40
The lecture explains run-time polymorphism, also called dynamic polymorphism or late binding, and introduces “Dynamic Method Dispatch / Dynamic Binding.” The slide lists the “Important Rules for Method Overriding”: the method name must be the same in both parent and child classes, the parameter list must be the same as that of the parent method, and the return type must be the same or covariant. The “@Override” annotation is mentioned as a way to signal intent. A code example shows a Dog class overriding a sound method from an Animal parent class. When the code is executed, the console displays “Dog barks,” demonstrating that the child class’s method is invoked at runtime even when called through a parent-type reference.
The lecture builds a clear two-part model of polymorphism. First, it establishes the definition and taxonomy: polymorphism is “one interface, many forms,” split into compile-time (static) and run-time (dynamic) forms. The flowchart consistently maps compile-time to method overloading and run-time to method overriding, giving students a visual anchor. The compile-time section uses a concrete Calculator example to show that overloading is resolved by the compiler based on the parameter list, producing static binding. The run-time section then contrasts this with dynamic binding, where the JVM selects the method at execution time based on the actual object type. The overriding rules—same name, same parameters, same or covariant return type—are presented as the contract that makes this safe. The Animal/Dog example with “Dog barks” output ties the abstract rules to observable behavior. For exam revision, students should remember the two types, their mechanisms (overloading vs. overriding), the binding type (static vs. dynamic/late), and the three overriding rules, using the Calculator and Animal/Dog examples as evidence of how each mechanism behaves.

