Put another way, you create a new kind of object by making a package containing existing objects. Thus, you can build complexity into a program while hiding it behind the simplicity of objects.
from Thinking in Java
Are not all objects independent of each other in Java? Is it possible to create a super object from different objects?
EDIT:
Alan Kay summarized five basic characteristics of Smalltalk way before Java was around. This is one of the characteristics of an OOP according to him. I was wondering if it is still valid for java.
An object can’t contain other objects directly in Java – but it can certainly hold references to other objects. I suspect that’s what the author is trying to get across.
So if a
Customerobject knows about the address, phone number, list of orders, name etc, those would all be separate objects… but instead of having to manage all of those explicitly, the user of aCustomerobject just keeps a reference to the object, and accesses the rest of the data via that single object.