Java 2 Interactive Programmer's Workbook

Source code for Chapter 04

Here is the source code to the exercises and examples for Chapter 04. When possible, we have linked to the corresponding applet as well. You will need to make sure that the Java 2 plug-in is installed on your browser.

Suggestion: Bring up the source code in a separate browser window so you can see the source code and the applet at the same time. To bring up a page in a new window, right-click on the link and select "View link in new window." If you have a three-button mouse, you can middle-click to do the same thing.


ComparisonOperatorsExample.java

EqualsExample1.java

EqualsExample2.java

EqualsMethodExample.java

EqualsVersusEqualsMethodExample.java

ForLoopColorsExample1.java

ForLoopColorsExample2.java

ForLoopColorsExample3.java

ForLoopExample1.java

ForLoopExample2.java

GreaterThanExample.java

GreaterThanPriceExample.java

InvalidValueExample1.java

InvalidValueExample2.java

LessThanExample.java

LessThanTooShortExample.java

PasswordExample.java

SimpleBooleanExample.java

SquaresForLoopExample.java

SquaresWhileExample.java

StringEqualsExample.java

SwitchDialPhoneExample.java

SwitchExample1.java

SwitchExample2.java

SwitchExample3.java

SwitchExample4.java

TemperatureExample1.java

TemperatureExample2.java

TemperatureExample3.java

TemperatureExample4.java

TemperatureExample5.java

WhileGreaterThanExample.java

WhileVectorExample.java


Authors: Kevin Chu and Eric Brower
Copyright 2000 Prentice Hall PTR