/* * Course: SE1011-011 * Term: Fall 2013 * Assignment: Lab 7 * Author: Brett Peavler * * This program relies on the Game.Die class, which you wrote for Game.Game. * See http://msoe.us/taylor/se1011/Game.Game for the UML diagram and specification. */ package game; public class Lab7_011_8_3 { public static void main(String[] args){ // Can often remove "this." // But watch out for run-time errors! // Two methods for using helper methods // 1. Breaking up long lists of code into logical sections // (simplify complicated algorithms) // 2. Reusing code Lab7State011_8_3 state = new Lab7State011_8_3(); // state.playGame(); // Back to Chapter 7 String str = ""; String str2 = ""; str.equals(str2); Lab7State011_8_3 state2 = new Lab7State011_8_3(); Lab7State011_8_3 state3 = new Lab7State011_8_3(); Lab7State011_8_3 state4 = state3; // Object comparison state2.equals(state3); // Reference comparison boolean areSame = state2 == state3; boolean areSame2 = state3 == state4; // Swapping values Complex011_8_3 c1 = new Complex011_8_3(1,3); Complex011_8_3 c2 = new Complex011_8_3(2,5); c1.swap(c2); System.out.println("c1: "+c1.toString()); System.out.println("c2: "+c2.toString()); } }