Tag Archives: UML

Java interface can extend many interfaces

Java is an object oriented programming language that follows these rules: An interface may extend any number of interfaces A class may extend no more than one class A class may implement any number of interfaces Implementation of these rules … Continue reading

Posted in Uncategorized | Tagged , , , | Leave a comment

Working with arrays of objects

Consider the following UML class diagram which shows the relationship between a superclass (Vehicle) and two subclasses (Motorbike and Car). Because Motorbike is a Vehicle and Car is a Vehicle, we can create an array of vehicles like this: The … Continue reading

Posted in Uncategorized | Tagged , , , , | Leave a comment

UML Composition Relationship — Java code example

The UML diagram shown below describes a composition relationship between Book and Page. This is a strong type of relationship — Book is responsible for creating, managing, and destroying all instances of Page. The filled-in diamond indicates this is a … Continue reading

Posted in Uncategorized | Tagged , , | 3 Comments

Java nested classes explained (alien head example)

Are you confused about Java nested classes? Do you know the difference between an inner class and an outer class? How about a static nested class and an inner class? I have written this brief guide to revise these terms … Continue reading

Posted in Uncategorized | Tagged , , , | Leave a comment