Polymorphism
One into many forms is the concept of polymorphism.
example 1: - method name is same but we can apply for different types arguments(Overloading).
public void m1(int) (Overloading)
public void m1(long) (Overloading)
public void m1(float) (Overloading)
example 2: - method signature is same but in parent class one type of implementation and in the child class another type of implementation(Overriding).
class Parent
{
public void m1()
{
System.out.println("Parent class method implemtation");
}
}
class Child extends Parent
{
public void m1()
{
System.out.println("Child class method implemtation");
}
}
Useful post... good work..
ReplyDelete