File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 4342
    
    7

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: 37936
    
  22
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
 
Similar Threads
Is-A relationship Doubt
Class and Interface Relation
... if code defines an is-a relationship
Enthuware: relationship is-like-a