Polymorphism - Assignment Hints
Polymorphism - Assignment Hints
Learning Objective:
To understand and implement the concept of Overloading in Java by creating a class and implementing method with
different sets of input arguments.
Assignment Details:
Create a Java class and create two methods with the same name passing different input arguments.
Requirements:
Hints to Solve:
- Include print statements inside each methods and pass input values
- Initialize objects and test the functionality by calling methods.
Reference Links:
Expected Outcome:
Upon completion, you should be able to:
- Grasp the fundamentals of method Overloading in Java.
- Understand the concept of compile time polymorphism
Demonstrating Overriding in Java
Learning Objective:
To understand and effectively utilize method overriding in Java to enable a subclass to provide a specific implementation
for a method defined in its superclass.
Assignment Details:
Create a Java class with a method and create a subclass that inherits from Super class and overrides the method
functionality.
Requirements:
- Create a superclass.
- Implement a method in the Super class.
- Create a subclass and Override that method in the sub class.
- Demonstrate the concept by creating objects for both classes and calling their methods.
Hints to Solve:
Reference Links:
Expected Outcome:
- Grasp how method overriding facilitates polymorphism, enabling the selection of the appropriate method
implementation at runtime based on the object type.