Leveraging Java Classes and Packages

Although operators and data types are obviously very important in Java, classes are where the real action is.

A class is a group of objects with similar properties (attributes), common behavior (operations), common relationships to other objects, and common semantics. An object, on the other hand, is an instance of a class, dynamically created by the program during runtime. In other words, classes define objects; objects, on the other hand, are specific, concrete instances of a class.

Note

In most languages, you can place related routines or classes into a library. Java is no exception—here libraries are called packages. You'll learn more about packages when you build an applet later in this chapter.

This ...

Get Platinum Edition Using XHTML™, XML, and Java™ 2 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.