Search code examples
javaandroidumlclass-diagram

Confused on how to represent these items in a class diagram


I am unsure how to represent the following 3 in a class diagram or whether some of they should be represented at all in a class diagram. I have gone through the UML spec but am still confused on the ones below:

1) 2) 3) are all in a another class named Vehicle, how would you represent each of them in a class diagram.

1) List<Car> cars = new ArrayList<>(20);
2) Cars car1;
3) import com.esoxjem.carmanual.Cars;

4) What if a cars object is created in the Car class itself. How would that be represented?

If someone could draw example of the above situation it would be incredibly helpful.


Solution

  • I only see one class... CARS. The diagram would be only one class