/* * RedmondScoreboardSimpleDemo.java * * Created on April 11, 2002, 10:43 AM */ /** * * @author redmond * @version */ public class RedmondScoreboardSimpleDemo { /** Creates new RedmondScoreboardSimpleDemo */ public RedmondScoreboardSimpleDemo() { } /** * @param args the command line arguments */ public static void main (String args[]) { ScoreBoard game1 = new ScoreBoard(); System.out.println("Who is the home team?"); String home = SavitchIn.readLine(); System.out.println("Who is the away team?"); String away = SavitchIn.readLine(); game1.beginGame(home,away); System.out.println("At Start of Game: " + game1.toString()); ScoreBoard game2 = new ScoreBoard(); //ScoreBoard game3 = new ScoreBoard(); //ScoreBoard game4 = new ScoreBoard(); game2 = game1; /// point of emphasis //game3.beginGame(home,away); //game3.copyOf(game1); //game1.copyMe(game4); System.out.println("Game2: " + game2.toString()); //System.out.println("Game3: " + game3.toString()); //System.out.println("Game4: " + game4.toString()); game1.makeTwoPoint("La Salle"); System.out.println("Game1: " + game1.toString()); System.out.println("Oops - Game2: " + game2.toString()); //System.out.println("Game3: " + game3.toString()); //System.out.println("Game4: " + game4.toString()); if (game1 == game2) { System.out.println("Game 1 and game 2 exactly equal - same memory"); } else { System.out.println("Game 1 and game 2 NOT exactly equal - NOT the same memory"); } /* if (game3 == game4) { System.out.println("Game 3 and game 4 exactly equal - same memory"); } else { System.out.println("Game 3 and game 4 NOT exactly equal - NOT the same memory"); } */ if (game1.equals(game2)) { System.out.println("Game 1 and game 2 have same content"); } else { System.out.println("Game 1 and game 2 NOT have same content"); } /* if (game3.equals(game4)) { System.out.println("Game 3 and game 4 have same content"); } else { System.out.println("Game 3 and game 4 NOT have same content"); } **/ } }