public class ClassTesting { public static void main(String[] args) { Student s1, s2, s3; s1 = new Student(); //test default constructor System.out.println(s1); s2 = new Student("Johnny", "Appleseed", 523341l); //note the 'l' to indicate a long s3 = s2; //don't need to instantiate s3. Have it simply point to s2. s3.setFirstName("Barney"); //will also change the state of s2 since both s1 and s2 point to the same object System.out.println(s2); if ( s1.equals(s2) ) //test equals method System.out.println("s1 and s2 objects have the same state."); else System.out.println("s1 and s2 objects do not have the same state."); Student s4 = new Student(s3); //test copy constructor //confirm that copy constructor works if ( s3.equals(s4) ) //test equals method System.out.println("s3 and s4 objects have the same state."); else System.out.println("s3 and s4 objects do not have the same state."); //confirm that '==' compares addresses NOT state! if ( s3==s4 ) System.out.println("s3 and s4 are pointing to the same object."); else System.out.println("s3 and s4 are not pointing to the same object."); System.out.println(); } //end method main() } //end class ClassTesting