We already have built a class Point that represents a point in 2D space. Now we would like to build a class to represent a Circle. A circle is defined by its center and its radius - given those two pieces of information, we can calculate anything else we might need like its area or diameter.
This could work just fine. But, as the circle gets more complex, it is likely going to have to implement some of the same logic as our existing Point class. For example, if I want to know if two circles overlap, I could see if the distance between their centers is less than the sum of their radii. To do that, I would need to use the distance formula. Point already has a method to do the distance formula - copy/pasting that code into Circle sounds like the wrong approach.
A better way to make use of our existing Point code is to define our Circle class in terms of a Point. We can define a Circle as something that has a Point and a radius:
Defining one class in terms of another is known as composition. Composition is one of the key ways object-oriented programming allows us to reuse code in new ways. Composition implies a has-a relationship with a strong sense of ownership. A Circle Point that is its center. That Point belongs to the Circle - if the Circle goes away, we would expect the Point to disappear with it.
A complete UML diagram of our data types would show both Point and Circle. We represent the relationship between them using a line that connects the two class diagrams. Finally, we place a filled diamond where the line meats the βowningβ class. Since Circle βhas aβ Point, we place the diamond next to the Circle box: