Skip to content

adiithi0510-alt/java-runtime-polymorphism

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Runtime Polymorphism in Java

A beginner-friendly Java program demonstrating runtime polymorphism (dynamic method dispatch) — one of the four pillars of Object-Oriented Programming.

What it covers:

A base class (Animal) with an overridable method (makeSound()) Multiple subclasses (Dog, Cat, Cow) that override the method A main class that calls the method via a parent reference — where the JVM decides at runtime which version to execute

Why it's useful: Shows how the same method call behaves differently depending on the actual object type, without needing to know the type at compile time.

About

A beginner-friendly Java program demonstrating runtime polymorphism using method overriding. Shows how a parent class reference calls subclass methods dynamically at runtime — a core OOP concept.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages