Tell the difficulties that i am difficult.
saloni jhanwar wrote:there is no more than one IS-A relationship
Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
Anayonkar Shivalkar wrote:
saloni jhanwar wrote:
I hope this helps.
This below code is from k&b and this is an example of more than one IS-A relationship through inheritance and interface implementation.
Now whereas in oracle example
So i think more than one IS-A possible only using both inheritance and interface implementation and there is nothing like that in oracle example.
Tell the difficulties that i am difficult.
saloni jhanwar wrote:So i think more than one IS-A possible only using both inheritance and interface implementation and there is nothing like that in oracle example.
Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
Tell the difficulties that i am difficult.
saloni jhanwar wrote:Can anyone help me ? please
Anayonkar Shivalkar wrote:In other words, MountainBike can take two forms(i.e. two identities). In one, you can call methods from Object class over it (e.g. toString) and in another form, you can call methods from Bicycle class (printDescription).
Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
Anayonkar Shivalkar wrote:
Tell the difficulties that i am difficult.
Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
Anayonkar Shivalkar wrote:
saloni jhanwar wrote:there is no more than one IS-A relationship
Well, MountainBike IS-A Object, and MountainBike IS-A Bicycle.
In other words, MountainBike can take two forms(i.e. two identities). In one, you can call methods from Object class over it (e.g. toString) and in another form, you can call methods from Bicycle class (printDescription).
Further, at code level, you can pass MountainBike object to all methods which expects
1) Object object
2) Bicycle object
3) MountainBike object
I hope this helps.
Do you want ants? Because that's how you get ants. And a tiny ads:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|