CHAPTER 16
Beginner
Polymorphism in Java
Updated: May 17, 2026
5 min read
# CHAPTER 16
Polymorphism in Java
1. Introduction
Polymorphism means "many forms." In Java, a single method or reference can behave differently based on context. A parent reference can hold a child object, and the correct method is called at runtime. This is the cornerstone of flexible, extensible software design.2. Types of Polymorphism
Compile-time (Static): Method Overloading — resolved at compile time. Runtime (Dynamic): Method Overriding — resolved at runtime via dynamic dispatch.3. Compile-Time Polymorphism (Overloading)
java
4. Runtime Polymorphism (Overriding)
java
5. The instanceof Operator
java
6. Upcasting and Downcasting
java
7. MCQ Quiz with Answers
Question 1
Polymorphism means:
Question 2
Method overloading is:
Question 3
Method overriding is:
Question 4
Dynamic method dispatch determines:
Question 5
Shape s = new Circle(); s.draw(); calls:
Question 6
instanceof checks:
Question 7
Upcasting is:
Question 8
Can you override a static method?
Question 9
Can you override a private method?
Question 10
Which enables runtime polymorphism?
8. Interview Questions
- Q: Explain compile-time vs runtime polymorphism.
- Q: What is dynamic method dispatch?
- Q: Can constructors be polymorphic?
- Q: What is the difference between method hiding and method overriding?