Beginning Java

In this chapter, the reader runs his or her first programs by applying the fundamental concepts covered in Chapter 1. The chapter also begins a discussion on classes and objects.

Source Code

The following .zip download contains the full source code for each programming example provided in this chapter.

Download the Source Code (Chapter 2)


1. Hello World: A simple hello world program demonstrating the System.out.println() method.

2. Simple Calculator Program: A simple four function calculator program demonstrating the use of if statements.

3. Simple Counting Program:  A counting program that utilizes a loop to determine whether a number is even or odd.

4. Basic Objects:  A two-class program that shows how to create and use your own classes.

5. Fun With Strings:  A simple example that demonstrates the use of the Javadocs to find built-in Java methods and use them.

6. Dice Project: Shows the reader how a random” number generator can be implemented using Java.

7. Groups: Combines many of the topics covered in Chapters 1 and 2 to create and manipulate an ArrayList of Person objects.

Importing Instructions:

Click Here to see how to import the above projects into your workspace.

Additional Information

1. Video Guide (Coming Soon)

2. More on Semicolons: Learn about when the semicolon is needed and when it is not.

3. For a list of all known in-text errors, please see the Errata.

This section will be updated as needed. Please post on our forums if you need assistance or explanation on topics covered in this chapter.