File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Diagrammatic representation of inheritance. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Diagrammatic representation of inheritance." Watch "Diagrammatic representation of inheritance." New topic

Diagrammatic representation of inheritance.

Venu Chakravorty
Ranch Hand

Joined: Aug 19, 2009
Posts: 46
Consider 2 classes 'Animal' and 'Dog', where 'Dog' is a subclass of 'Animal'. Which one of the following two diagrammatic representations are correct?

Representation 1 (up arrow):
This shows that 'Dog' extends 'Animal' and is more specific (narrower) than 'Animal'. Moreover 'Dog' points to it's super class.

Representation 2(down arrow):
This shows that 'Dog' has at least all the attributes (ignoring access specifiers) of 'Animal'. It makes me think that these attributes have been imported into 'Dog' and that 'Dog' has come from 'Animal'.

Which one would be right if I were to draw on a paper?

Regards, venu.
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

This has little to do with java, much more with uml. So it would be better to post there. However just google uml class diagram and you will find what your looking for.

"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
I agree. Here's the link:
subject: Diagrammatic representation of inheritance.
It's not a secret anymore!