Java Reference
In-Depth Information
permission in that directory (check the permissions with ls -ld . ) then you
can run these commands:
$ cd /usr/local/java
$ unzip -q /tmp/j2sdk-1_4_2-doc.zip
There may be quite a pause (tens of seconds) while it unzips everything.
The unzip command will spew out a huge list of filenames as it unpacks them
unless you use the -q option (“quiet”) on the command line (which we did, to
avoid all that). The files are all unzipped into a directory named docs . So now
you can point your browser to
file:///usr/local/java/docs/api/index.html
Now you have your own local copy for quick reference, regardless of how
busy the network or Sun's Web site gets. Be sure to bookmark this page; you'll
want to reference it often. It's your best source of information about all the
standard Java2 classes.
3.2.3
This section is not intended to be a formal presentation of Java syntactic
elements. 3 Our purpose here is merely to show you the Java way to express
common programming constructs. You will find that these are fundamentally
similar to the analogous statements in C and C++. For much more detail on
these subjects, see Chapter 3 of Thinking in Java by Bruce Eckel.
Like C, Java has a very small set of statements. Most constructs are actually
expressions . Most operations are either assignments or method calls. Those few
statements that are not expressions fall into two broad categories:
Statements
• Conditional execution statements
• Loop control statements
By the way, you may have already noticed one of the two kinds of
comments that Java supports. They are like the C/C++ comments—a pair of
slashes ( // ) marks a comment from there to the end of the line, and a block
3. For those so inclined, Sun has a BNF language grammar ( http://java.sun.com/docs/
books/jls/second_edition/html/syntax.doc.html ) on their Web site, and the Lewis and
Loftus book, Appendix L, has a good set of syntax diagrams.
Search WWH ::




Custom Search