Bahir Dar Chapter Four
Bahir Dar Chapter Four
02 Abstraction
Abstract class, abstract method, interface, declaring interface
constants,
Polymorphism
Polymorphism
Polymorphism: means the ability to take more than one form.
It can be defined as the same thing being used in different forms.
Polymorphism is a OOPs concept where one name can have many
forms.
An operation may exhibit different behavior in different instances.
14
Polymorphism using overridden methods
Output
15
Polymorphism using overloading methods
Overloaded methods: let you reuse the same method name in a
class, but with different arguments (and optionally, a different return
type).
Java permits you to reuse method name for more than one method.