/* * Course: SE1011-011 * Term: Fall 2013 * Assignment: Lab 7 * Author: Brett Peavler * * This program relies on the Die class, which you wrote for Lab7. * See http://msoe.us/taylor/se1011/Lab7 for the UML diagram and specification. */ public class Lab7_051_8_3 { public static void main(String[] args){ Lab7State051_8_3 state = new Lab7State051_8_3(); state.playGame(); // "this" is a reference variable that points to // the instance of the class that we used to // call the current method. // A reference variable is a variable refers to another // location in memory, specifically to another object. // And object is an instance of the class. // Return to Chapter 7 Lab7State051_8_3 state2 = new Lab7State051_8_3(); Lab7State051_8_3 state3 = new Lab7State051_8_3(); // Compare objects System.out.println("The objects are equal: " + state2.equals(state3)); // Compare references System.out.println("The references point to the same object: "+(state2 == state3)); Complex051_8_3 c1 = new Complex051_8_3(1,2); Complex051_8_3 c2 = new Complex051_8_3(2,10); c1.swap(c2); } }