Core java |video 7| English

Опубликовано: 19 Март 2026
на канале: variety track
42
0

Polymorphism
Poly-many
Morphism-forms
It refers to the ability of an object to take on multiple forms. It allows
Object of different classes to be treated as object of common class.
1.Method overloading (static binding/compile time polymorphism)
2.Method overriding (dynamic binding/run time polymorphism)

1.Method overloading: A class contains more than one method with the same name is called method overloading

Class MethodOverloading
{
Void method 1()
{
//code
}
Void method 1()
{
//code
}
}
1)Number of parameters
2)Order of parameters
3)datatype of parameters


2.Method overriding:

Class name-differ (using extends) Method-same Argument- same
➢ In a different class, the method name should be same and argument name should be same is called overriding.
Project : BankDetails
Package : org.bank
Class : BankInfo
Methods :saving(),fixed(),deposit()
Class :TaxisBank
Methods :deposit()
super
Description:
You have to override the method deposit in TaxisBank.