Saibabaa Pragada wrote:Second answer is, Dog IS-A Dog..I don't know how come this is possible.
Are you saying that a Dog instance is not a Dog instance?
As a side note, the java specifications actually mentions that any class type is its own type -- identity is supported. It's mainly done to make the specification clearer. And also to allow redundant casts in expressions.
I was told that IS-A means, we should use either extends or implements Runnable.
--> Please cross check
This is seriously going off the track!..
Consider following points:
1) Since its an objective question, which has various options and Dog IS-A Animal is fine. Only other option that can be selected is Dog IS-A Dog, all other options are 100% wrong.
2) However please note a code like
will not compile, saying Cyclic Dependency.
3) benefit of doubt to Dog IS-A Dog since you can cast a Dog instance to Dog Type.