Java Reference
In-Depth Information
final A final class cannot be subclassed. Subclassing is discussed
in Chapter 3 .
strict floating point A class declared strictfp has all floating-point
arithmetic in the class evaluated strictly. See " Strict and Non-
Strict Floating-Point Arithmetic " on page 203 for details.
A class cannot be both final and abstract .
A class declaration can be preceded by several modifiers. Modifiers are
allowed in any order, but we recommend that you adopt a consistent
order to improve the readability of your code. We always use, and re-
commend, the order listed.
While we won't be concerned about class modifiers in this chapter you
need to know a little about public classes. Most Java development tools
require that a public class be declared in a file with the same name as
the class, which means there can only be one public class declared per
file.
Exercise 2.1 : Write a simple Vehicle class that has fields for (at least)
current speed, current direction in degrees, and owner name.
Exercise 2.2 : Write a LinkedList class that has a field of type Object and
a reference to the next LinkedList element in the list.
 
Search WWH ::




Custom Search