7.12. Summary

The Java programming language is pervasively and consistently object oriented. You cannot go anywhere in Java without a good grasp of how to use objects. This chapter summarized how to create objects, give them state (instance variables), and assign them behavior (methods). Using inheritance, you can build hierarchies of classes without repeating code that is shared by subclasses. Although Java lacks multiple inheritance, interfaces are a convenient mechanism for letting one method handle objects from different hierarchies in a uniform manner. Class hierarchies that are intended to be reused should be documented with javadoc and can be organized into packages for convenience.

Getting comfortable with objects takes a bit of a conceptual ...

Get Core Web Programming, Second Edition 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.