Professional Documents
Culture Documents
PROGRAMMING CONCEPTS
(Review)
What is an Object?
Objects have states and behaviors. Example: A dog
has states - color, name, breed as well as behaviors -
wagging, barking, eating. An object is an instance of
a class.
}
The implements keyword is used by classes by inherit
from interfaces. Interfaces can never be extended by
the classes.
}
What Is an Interface?
An interface is a collection of abstract methods. A class
implements an interface, thereby inheriting the abstract
methods of the interface.
An interface is not a class. Writing an interface is similar to writing a
class, but they are two different concepts. A class describes the
attributes and behaviors of an object. An interface contains behaviors
that a class implements.
interface Bicycle {
// wheel revolutions per minute
void changeCadence(int newValue);
void changeGear(int newValue);
void speedUp(int increment);
void applyBrakes(int decrement);
}
What Is a Package?
A package is a namespace that organizes a set of
related classes and interfaces
}
RESOURCES
http://docs.oracle.com/javase/tutorial/java/concepts/i
ndex.html