Monday, February 27, 2012

Java OOPS ...PolyMorphism

1)Static Polymorphism
Method overloading
methods overloaded in class with same name, but different datatype and no of argument
int test(int a, intb);
double test(double y);
2)Dynamic Polymorphism
Method overriding
Overriding the method of parent class.
class A{
int method (int x){}

}
class B extends A{
int method (int x){}
}
All the interfaces are example of method overriding


No comments:

Post a Comment