• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

"is a" Vs "has a"

 
Sadaf Zaidi
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please tell me about "is a " and "has a".
Thanks
 
Rikard Qvarforth
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ..
well a cat "is a" animal .. ok ?
..in java that is = "class Cat extends Animal" a animal can be a cat ..
and a cat "has a" mjaiu call
.. in java that is
class cat extends animal{
private String soundCall = "mjaiu";
}
the "has a" is exclusive to the class .. but look at this
a person "is a" human .. class person extends human
a person "has a" head .. class person implements head
person nisse = new person();
so nisse "has a" head but a cat can also have a head..
class cat extends animal implements head
hope this helps ..
my english is sucks .. hummm



 
Fei Ng
Ranch Hand
Posts: 1245
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try reading this...
http://www.javaranch.com/campfire/StoryPoly.jsp
 
William Barnes
Ranch Hand
Posts: 986
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

my english is ****

I understood everything fine except for "mjaiu".
 
Marilyn de Queiroz
Sheriff
Posts: 9066
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"mjaiu" = "meow"
 
Rikard Qvarforth
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
he he well my cat at home is litle strange
 
Sadaf Zaidi
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for all of your replies but, yet its not clear to me.
[This message has been edited by Sadaf Zaidi (edited November 25, 2001).]
 
Marilyn de Queiroz
Sheriff
Posts: 9066
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

 
Sadaf Zaidi
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Marilyn deQueiroz .Its clear now.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic