Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

doubt in IS-A relationship

 
Parameswaran Thangavel
Ranch Hand
Posts: 485
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i doubt how this statisfies the IS-A relation

public class Species { }
public class Animal {private Species species;}

the class Animal has a reference to the class species....

literally is-a means extends....

can any one clear me?
Thanks in advance.
 
Animesh Shrivastava
Ranch Hand
Posts: 298
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah u right,
The question doesnt satisfy IS-A relationship.
IS-A means having extends relationship with the class
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Car is-a Vehical

class Vehical {

}

class Car extends Vehical {

}
 
Manash Das
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Parameswaran Thangavel:
hi
i doubt how this statisfies the IS-A relation

public class Species { }
public class Animal {private Species species;}

the class Animal has a reference to the class species....

literally is-a means extends....

can any one clear me?
Thanks in advance.



whenever you are extending any class then it is always a is-a relationship and whenever you were actually using a particular class in other class or you has the class(Species) in the class(Animal) the you are in has a relationship.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic