Java Reference
In-Depth Information
5
Defining Classes II
After a certain high level of technical skill is achieved, science and art
tend to coalesce in esthetics, plasticity, and form. The greatest scientists
are always artists as well.
ALBERT EINSTEIN, Quoted in Alice Calaprice,
The Quotable Einstein
Introduction
This chapter is a continuation of Chapter 4. It covers the rest of the core material on
defining classes. We start by discussing
which are
methods and variables that belong to the class as a whole and not to particular
objects. We then go on to discuss how class type variables name objects of their class
and how class type parameters are handled in Java.
This chapter also discusses
static
methods
and
static variables,
which are Java's way of grouping classes into
libraries. We end this chapter with a discussion of
packages,
, a program that automati-
javadoc
cally extracts documentation from classes and packages.
Prerequisites
This chapter uses material from Chapters 1 through 4.
Sections 5.3 and 5.4 are independent of each other and may be covered in any
order. Section 5.3 covers some subtle points about references, and Section 5.4 covers
packages and
is not used in the rest of this topic.
The other material in Sections 5.3 and 5.4 is not heavily used in the next few chapters
and can be digested as needed if the material seems difficult on first reading.
The material on packages in Section 5.4 assumes that you know about directories
(which are called folders in some operating systems), that you know about path names
for directories (folders), and that you know about PATH (environment) variables.
These are not Java topics. They are part of your operating system, and the details
depend on your particular operating system. If you can find out how to set the PATH
variable on your operating system, then you will know enough about these topics to
understand the material on packages in Section 5.4.
. The material on
javadoc
javadoc
Search WWH ::




Custom Search