Professional Documents
Culture Documents
In a Java class, we can create methods with the same name if they
differ in parameters.
Method
Overriding
LET’S TRY!
Directions: Determine the output of the examples program in java. Then
identify if it is method overloading or method overriding.
2. Output:
woof
woof
woof
Method
Overloading
HANDS-ON
ACTIVITY
IT’S YOUR TIME TO
SHINE!
The programmer, the dancer, and the
singer are types of Person that would be
represented by subclasses of the Person
class. A person class has the methods
learn(), walk(), and eat(). Include
attributes such as Name and designation.
Construct a Java program that will show
polymorphism for the sample scenario.
IT’S YOUR TIME TO
SHINE!
Consider the following example, Shape is
super class for Rectangle and Triangle
class. Construct a Java program that will
show polymorphism for the sample
scenario.
Rubrics for Creating a Java program
WHAT HAVE YOU
LEARNED?
1. What is
polymorphism in Java?
2. How will you
achieve polymorphism
in Java?
WHAT HAVE YOU
LEARNED?