Date: Tue, 25 Mar 2003 13:27:33 -0600 (CST) From: Mark Jacobson To: 810-061-02@uni.edu Subject: Purple Rain example, and Big Java... Hi Java students, Please look over this example carefully, as we finish up chapter 5 of the William's textbook: http://www.cns.uni.edu/~jacobson/061/applets/PurpleRain/PurpleRain.html Read and reread section 5.7 Making active objects affect other objects as you study this code. i. Figure 5.15 is the DropCollector class. Compare the DropCollector2 class (linked to below) to the DropCollector class of page 156 of Williams textbook. ii. Figure 5.16 on page 157 is the FallingBall class. Compare to the FallingBall2 class shown below and linked to below. ------------------------------------------------------------------------ Also, below here is the Java that was demonstrated on cowboy.cns.uni,edu today after the exam one discussion and review. // Compare this program to the Hello.java file on page 17 // of the Big Java textbook by Cay Horstmann as you read // chapter one of the book. public class goPanthers { public static void main(String args[]) { int num = -999; int i = 0; while (i < 8) { System.out.println( " " + ++i + " Go, Fight, Win, UNI Panthers!" ); // i++; NO LONGER NEEDED... } System.out.println(num + "\n\n"); } } Note how the preincrement operation was used in the above code. The original i = i + 1 or i++ or ++i statement is commented out. --------- --- ---