[Previous] [Contents] [Next]


Some Background on OO and Java Concepts


Classes are abstract blueprints from which individual objects can be made. They define properties and behaviors (methods).

A class is a template for defining the behaviors and properties for a particular type of object.

In Table 15.1, we'll give an example of a class.

Table 15.1 An Example of a Class

Concept Example

Class car
Property speed
Behavior change gear

Using the blueprint shown in Table 15.1, we can create a car (object) that has a specific speed and is able to change gear. Interfaces define a set of methods but don't implement them.

An interface is a special kind of class that defines a set of methods.

A class can implement an interface, signing a kind of contract to provide (implement) the methods defined in the interface.

[Previous] [Contents] [Next]