Object Composition and Reuse
The fact that one object can be composed of, or built from, other objects is the heart of object-oriented programming. This allows more complex objects to be constructed from basic building blocks. For example, suppose that you are developing a drawing program. Your drawing application would consist of objects such as windows, menus, a drawing canvas, a tool palette, a color palette, and so on. Some of these objects are available in class libraries and others are built from more primitive components. You develop your drawing application by gathering and building its component classes and assembling them into an integrated whole.
Object composition not only enables you to simplify the organization of your programs, ...
Get Sun Certification Training Guide (310-025, 310-027): Java™ 2 Programmer and Developer Exams now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.