Sams Teach Yourself Java 2 in 24 Hours

Sams Teach Yourself Java 2 in 24 Hours

By Rogers Cadenhead

Hour 12. Making the Most of Existing Objects

This might be a surprise to you, but your Java objects are ideally suited for childbearing. When you create a program as an object—a set of attributes and behavior—you have designed something that's ready to pass these qualities on to offspring. Like most offspring, these child objects will take on a lot of the attributes and behavior of their parent. They can also do some things differently than their parent does; some extra attributes and behavior can be added that Pop is incapable of.

This system is called inheritance, and it's something every superclass (parent) gives to its subclasses (children). Inheritance is one of the most useful aspects of object-oriented programming, and you'll be learning more about it during this hour.

Another useful aspect of object-oriented programming is the capability to create an object that can be used with different programs. Reusability speeds up the software development process and makes it easier to develop error-free, reliable programs. Using Java and special development tools, you'll be able to develop JavaBeans—completely reusable Java objects that are easily incorporated into programs.

The following topics will be covered:

Share ThisShare This

Informit Network