Skip to main content

Ivor Horton's Beginning Java 2, JDK 5 Edition

Ivor Horton's Beginning Java 2, JDK 5 Edition

Ivor Horton

ISBN: 978-0-764-56874-9

Dec 2004

1512 pages

Select type: Paperback

Product not available for purchase


What is this book about?

This book is a comprehensive introduction to the Java programming language, updated thoroughly (more than 35% new and updated) for the latest SDK 1.5 release. This book shows readers how to build real-world Java applications using the Java SDK. No previous programming experience is required. The author uses numerous step-by-step programming examples to guide readers through the ins and outs of Java development. In addition to fully covering new features of SDK 1.5, such as generic types, the author has also added new chapters on Java database programming with JDBC and Java programming with XML.

About the Author.




Chapter 1: Introducing Java.

Chapter 2: Programs, Data, Variables, and Calculation.

Chapter 3: Loops and Logic.

Chapter 4: Arrays and Strings.

Chapter 5: Defining Classes.

Chapter 6: Extending Classes and Inheritance.

Chapter 7: Exceptions.

Chapter 8: Understanding Streams.

Chapter 9: Accessing Files and Directories.

Chapter 10: Writing Files.

Chapter 11: Reading Files.

Chapter 12: Serializing Objects.

Chapter 13: Generic Class Types.

Chapter 14: The Collections Framework.

Chapter 15: A Collection of Useful Classes.

Chapter 16: Threads.

Chapter 17: Creating Windows.

Chapter 18: Handling Events.

Chapter 19: Drawing in a Window.

Chapter 20: Extending the GUI.

Chapter 21: Filing and Printing Documents.

Chapter 22: Java and XML.

Chapter 23: Creating and Modifying XML Documents.

Chapter 24: Talking to Databases.

Chapter 25: The JDBC in Action.

Appendix A: Keywords.

Appendix B: Computer Arithmetic.


  • Ivor Horton is a leading author of computer programming language tutorials; his Beginning Java has sold more than 150,000 copies in all editions.
  • The author is known for his unique tutorial style, readily accessible to both novice and experienced programmers.
  • The book will include exercises and solutions.
  • The latest edition fully covers the most recent release of Java, JDK 5, and adds new coverage of database and XML programming.
Update for Java SE 6
Code downloads for this title are available here.
Code from the book in .rar format.
Here is the code stored in the .rar archive format at ~1/5 the size of the .zip version. If your compression software does not support the .rar format you will need a program like WinRAR to uncompress the files. Get a trial version of WinRAR at
Code from the book in .zip format.
Solutions to the Exercises in .rar format.
Here are the solutions stored in the .rar archive format at ~1/4 the size of the .zip version. If your compression software does not support the .rar format you will need a program like WinRAR to uncompress the files. Get a trial version of WinRAR at
Solutions to the Exercises in .zip format.
Error in Code -
The corrected code for the deleteItem() method in the LinkedList class is attached.
ChapterPageDetailsDatePrint Run
Figures 1-4 and 1-5Error in Code,In both figures 1-4 and 1-5 the closing brace should be a right brace, } 06/02/2010
18Figure 1-7,The putHatOn() method appears twice. In place of the duplicate putHatOn() method, there should be a definition for the takeHatOff() method, as follows:
// Method to take the hat off
public void takeHatOff()   {
     hatOn  =  false;                 // Record hat status as off
19Figure 1-7,In figure 1-7 the first line of the constructor definition and the comment preceding it should have CowboyHat in place of Hat, so they should be:

// Constructor to create a CowboyHat object
public CowboyHat(String person, int theSize)
36Bottom right table entry,In the bottom right table entry the last sentence has a superfluous right parenthesis so it should read:
The smallest non-zero value that you can have is roughly ±4.9x10-324.
37Last sentence in paragraph at top of page,In the last sentence in the paragraph at the top of the page 9.0E-28 should read 9.0E-28. 1/22/05
43Figure 2-3,In Figure 2-3 the first line of the main() method should be:
public static void main(String[] args) {
452nd to Last Sentence, 2nd to Last Paragraph,The second to last sentence in the second to last paragraph should read:

When the dividend is a negative integer of the largest possible magnitude and the divisor is -1 the result is the same as the dividend, which is negative and therefore violates the rule.
50Last sentence at bottom of page,The last sentence at the bottom of the page has a symbol missing and is unclear. It should be replaced by the following:
For the more mathematically minded the result, r, of the expression a%b, where a and b are non-zero floating-point values, is defined by the expression a-(n.b). The value n has the same sign as a/b and is the largest possible integer such that a/n is less than or equal to the true quotient a/b.
552nd to last sentence in the 1st paragraph,The second to last sentence in the first paragraph contains a left parenthesis where the symbol p should appear. It should therefore read:
The Math class also defines double values for e and p, which you can access as Math.E and Math.PI respectively.
58Last code line for "Try It Out: The Math Class",There is a discrepancy between the code for Try It Out: The Math Class and the sample output given. The last code line should be:
System.out.println( The radius of a pond with area + pondArea + square feet is + feet + feet + inches + inches );
58Symbols in "How It Works" section,Symbols in the second paragraph in the How It Works section are not displayed correctly. The second sentence in this paragraph should read:
Since the area of a circle with radius r is given by the formula pr2, the radius must be Ö(area/p), so you specify the argument to the sqrt() method as the expression pondArea/Math.PI, where Math.PI references the value of p that is defined in the Math class:
62Error in "How it Works",In the paragraph in the How