Meaningless Drivel is fun!*
The moose likes Beginning Java and the fly likes Java different type of relationship among classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java different type of relationship among classes" Watch "Java different type of relationship among classes" New topic
Author

Java different type of relationship among classes

Amanda Mosby
Greenhorn

Joined: Apr 05, 2012
Posts: 3
i am confused about what are different relationship termed when

1) when a class extends another class
2) when a class implements interface
3) when a class have another class object as data member

are there any other kind of relationship?

I also found this Has-A Relationship at codeRanch, but answers here confuse more than before
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4426
    
    8

1 and 2 are both IS-A relationships, whereas 3 is usually termed a HAS-A relationship.

I'd say there are also relationships when:

- a class creates an instance of another class
- a class has a method taking a parameter of another class
- a class has a method returning an instance of another class

I'm not sure I've heard specific names for those relationships, though. Maybe "USES"?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39478
    
  28
Not quite sure what you want. Do you simply want to know what they are called?

This YouTube link seems promising, I have only watched the first 5 minutes.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java different type of relationship among classes