Java Reference
In-Depth Information
is part of the fruit class, which is under the larger class food . That is, the food class pos-
sesses certain qualities (edible, nutritious, etc.) which also, logically, apply to its subclass,
fruit . In addition to these qualities, the fruit class has specific characteristics (juicy, sweet,
etc.) that distinguish it from other food. The apple class defines those qualities specific to
an apple (grows on trees, not tropical, etc.). A Red Delicious apple would, in turn, inherit
all the qualities of all preceding classes, and would define only those qualities that make it
unique.
Without the use of hierarchies, each object would have to explicitly define all of its char-
acteristics. Using inheritance, an object need only define those qualities that make it unique
within its class. It can inherit its general attributes from its parent. Thus, it is the inheritance
mechanism that makes it possible for one object to be a specific instance of a more general
case.
Obtaining the Java Development Kit
Now that the theoretical underpinning of Java has been explained, it is time to start writing
Java programs. Before you can compile and run those programs, however, you must have
the Java Development Kit (JDK) installed on your computer. The JDK is available free of
charge from Oracle. At the time of this writing, the current release of the JDK is JDK 8.
This is the version used by Java SE 8. (SE stands for Standard Edition.) Because JDK 8
contains many new features that are not supported by earlier versions of Java, it is recom-
mended that you use JDK 8 (or later) to compile and run the programs in this topic. If you
use an earlier version, then programs containing new features will not compile.
The JDK can be downloaded from www.oracle.com/technetwork/java/javase/down-
loads/index.html . Just go to the download page and follow the instructions for the type
of computer that you have. After you have installed the JDK, you will be able to compile
and run programs. The JDK supplies two primary programs. The first is javac , which is
the Java compiler. The second is java , which is the standard Java interpreter and is also
referred to as the application launcher .
One other point: The JDK runs in the command prompt environment and uses command-
line tools. It is not a windowed application. It is also not an integrated development envir-
onment (IDE).
NOTE
In addition to the basic command-line tools supplied with the JDK, there are several high-
quality IDEs available for Java, such as NetBeans and Eclipse. An IDE can be very help-
ful when developing and deploying commercial applications. As a general rule, you can
Search WWH ::




Custom Search