I f

Some Valid obect creation....
Cone c1= new Cone();
Ctwo c2= new Ctwo();
Cone c= new Ctwo();
Object O= new Cone();
Object o= new Ctwo();
This is somewhat called as polymorphism
But from Cone object we cant access the CTwo class methods . To access the CTwo class methods,
we have to typecaste COne object into CTwo object
Ctwo c2= (CTwo)c1;
Some Valid obect creation....
Cone c1= new Cone();
Ctwo c2= new Ctwo();
Cone c= new Ctwo();
Object O= new Cone();
Object o= new Ctwo();
This is somewhat called as polymorphism
But from Cone object we cant access the CTwo class methods . To access the CTwo class methods,
we have to typecaste COne object into CTwo object
Ctwo c2= (CTwo)c1;
No comments:
Post a Comment