Java Reference
In-Depth Information
• Why the absence of templates in Java is not as crippling as a C++
programmer might suppose.
• How final is better than virtual and how interfaces are often better
than multiple inheritance.
This is going to be a whirlwind tour. Our topic assumes that you already
know programming in general, and have had some exposure to OO program-
ming. We are going to distill into a single chapter material that comprises sig-
nificant portions of other topics. In particular, if there are concepts here that
you are not already familiar with, look at Chapters 1-9 of Bruce Eckel's won-
derful topic, Thinking in Java , 3rd ed., published by Prentice Hall PTR (ISBN
0-131-00287-2). It is, genuinely, one of the best topics on the market for
learning the Java language and the design principles Java embodies.
If you are somewhat new to programming, but technically quite adept
(maybe a system administrator or database administrator with little formal
programming background), you may want to supplement your reading with a
topic that, unlike Eckel's, is targeted more toward the novice programmer. We
like Java Software Solutions: Foundations of Program Design , 3rd ed., by John
Lewis and William Loftus, Addison-Wesley, 2003 (ISBN 0-201-78129-8).
It will introduce the concepts behind the programming constructs, whereas
we will assume that you know these concepts so we can focus only on the
Java syntax.
3.2
F UNDAMENTAL L ANGUAGE E LEMENTS
Before the object-oriented structures, Java (like C) has a small number of
fundamental statements and (again, like C and C++) some fundamental
“nonobject” data types. 1
1. The existence of these nonobject data types is another thing that brings up criticism of the
Java language. Since Java does not have C++'s operator overloading features, you cannot use
objects in standard algebraic expressions. I'm not sure if the inclusion of scalar classes was mo-
tivated by speed, or by the lack of operator overloading. Whatever the reason, like any other
design compromise, it has both advantages and disadvantages, as we shall see throughout
the topic.
Search WWH ::




Custom Search