Java Reference
In-Depth Information
also use an IDE to compile and run the programs in this topic if you so choose. However,
the instructions presented in this topic for compiling and running a Java program describe
only the JDK command-line tools. The reasons for this are easy to understand. First, the
JDK is readily available to all readers. Second, the instructions for using the JDK will be
the same for all readers. Furthermore, for the simple programs presented in this topic, us-
ing the JDK command-line tools is usually the easiest approach. If you are using an IDE,
you will need to follow its instructions. Because of differences between IDEs, no general
set of instructions can be given.
Ask the Expert
Q :
You state that object-oriented programming is an effective way to manage large
programs. However, it seems that it might add substantial overhead to relatively
small ones. Since you say that all Java programs are, to some extent, object-ori-
ented, does this impose a penalty for smaller programs?
A : No. As you will see, for small programs, Java's object-oriented features are nearly
transparent. Although it is true that Java follows a strict object model, you have wide
latitude as to the degree to which you employ it. For smaller programs, their “object-
orientedness” is barely perceptible. As your programs grow, you will integrate more
object-oriented features effortlessly.
A First Simple Program
Let's start by compiling and running the short sample program shown here:
Search WWH ::




Custom Search