Programming With Java - An Algorithmic Introduction: Appendix 1 - Recommended Further Reading
Programming With Java - An Algorithmic Introduction: Appendix 1 - Recommended Further Reading
There are now hundreds of text books that describe Java, provide insight into advanced features of Java, or claim
to be suitable for learning to program from scratch in Java. Of the latter there are several that teach "objects first"
and others (like the present book) that teach "objects later". Among all these, the following may be worth
drawing to your attention. Several of these have been though several editions, trying to track changes in Java.
Another really excellent book with a mass of insight, but it is not a beginner's book. You have to know
Java to be able to benefit.
Kathy Sierra and Bert Bates: Head First Java (O'Reilly, 2005) (2nd Edition)
A whimsical and amusing book, full of insight, but it is not really a first time text. Once you have learned
a quite a bit about Java you can learn a lot more from this one.
Very clearly written and a joy to read. Unfortunately it does not describe the latest features of Java at all,
but it is an excellent text for the rest!
Much better than average book, with some very clear explanations, and quite accessible to beginners.
Samuel Kamin, Dennis Mickunas, Edward Reingold: An Introduction to Computer Science using Java
(McGraw-Hill, 2002) (2nd Edition)
A fairly well structured text, although objects are introduced quite early on before many fundamental
algorithmic concepts.
An interesting and sometimes controversial book from someone with a perceptive outlook on programming
language design
John Lewis and William Loftus: Java Software Solutions: Foundations of Program Design (Pearson, 2005
(4th Edition)
This was formerly used as a text at Rhodes. The many editions have chopped and changed, and it is now
quite heavy reading.
Tony Gaddis: Starting Out with Java: Control Structures through Objects (Addison Wesley, 2008) (3rd
Edition)
Formerly used as a text at Rhodes. Gaddis has a whole series of books on Java from various perspectives.
They give the impression of being badly edited - concepts are covered in a confusing order.
Ralph Bravaco and Shai Simonson: Java Programming: From The Ground Up (McGraw Hill, 2010)
A recent "fundamentals first" book which I found refreshing, even though, as with many others, there is a
huge amount to wade through!
Java key words cannot be used as identifiers. Note that const and goto are reserved for possible future use,
even though they are not currently used. true, false, and null are actually reserved literals but cannot be
used as identifiers either.
Java uses the Unicode character set, but the first 256 characters of this are the same as the very widely used ASCII
set which includes the alphabet, digit, and familiar punctuation characters.
Character literals are written between single quotes, as exemplified by 'a', 'x', '9'.
Not all character can be represented by themselves in that way. Java allows awkward characters to be represented
by so-called escape sequences.
Unicode characters may be specified by '\uNNNN' where NNNN is the hexadecimal representation of the position
in the Unicode character set. For example '\u004D' is equivalent to 'M', while '\u001B' represents
<ESC>, the character corresponding to pressing the ESC key on a keyboard
Unsigned short hexadecimal values may be represented by '\x00NN' where NNNN is the hexadecimal
representation of the short value. Values of the short and char types are both represented by 16 bit numbers.
There are some special values that are represented by sequences '\X' where X is itself a simple character. These
include
Input and output in Java programs is usually achieved in one of two ways
• Simple console based I/O using facilities like those provided in the IO library that has been used
extensively in this book
• GUI based IO, using multiple windows and event driven software
While the first of these is adequate for introductory programs, the GUI based approach requires the programmer
to have a fairly deep understanding of multiple advanced concepts.
The library described here has been developed from sources available on the Internet. It provides the ability to
regard a console single window as an (x,y) addressable area, and has facilities for writing text into this window at
specified points, and for reading values in response to prompts placed at appropriate points. Typically a window
can have at least 80 columns and 25 rows, but the exact size will be determined by the size of the console window
in which the application is executed.
This library affords the opportunity of writing fairly sophisticated applications, like those set as exercises from
chapter 15 onwards (or even before!)
import jcurses.system.*;
// Waits for keypress and returns key code. Most are ASCII but there are some
// function key mappings as shown here - more magic numbers
} // Screen
To make use of this package you must ensure that you have copied the files jcurses.jar and
libjcurses.dll into a directory that is listed in the CLASSPATH for your system (see section 10.7).
import library.Screen;
} // ScreenDemo0
A second demonstration program, showing how one might navigate around an initially blank screen and substitute
the characters typed at various positions, as the same time updating a matching rectangular matrix, as follows:
import library.Screen;
} // main
} // ScreenDemo1
The class below will allow I/O to be performed in very simple pop-up windows. Essentially all this buys you is
the ability to avoid using the console I/O of the IO library.
// Input routines
// Unlabelled
// Labelled
// Formatters
// Output routines
// Unlabelled
// Labelled
} // GIO