{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

10-05 Class Notes CS 107 - c[Done How can we get nicely...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
See a partial solution to the Tic-Tac-More problem. In particular pay attention to the implementation of the board and how this affects the adjacency checking. Think of how using multiple variables for the board compares to an implementation using arrays, which we will discuss today. I updated the lab7 description online, for those still working on it. Still no program #4 description Announcements: This program was: A B C D E too easy just right too hard Questions? Declaring variables as private is: A B C D E optional required for a good program How can we use either int or String to manipulate month values? [ overloading methods, utility conversion methods ] a. [Done] How can we create an object and initialize it all in one step? [ Constructors ] b. [Done] How can we prevent setting invalid values for instance variables? [ make instance variables private and create get.. and set.. methods ] c. [Done] How can we get nicely formatted output when we display an object
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ] c. [Done] How can we get nicely formatted output when we display an object using System.out.println(…)? * implementing the toString() method ] d. How can we chain code in Constructors so we don't have to write the same code multiple times? [ chain constructors using this as the first action in the constructor ] e. How can we make a copy of an object? [ copy constructor] f. Problems and [ solutions ], not necessarily in the following order. Last Time & Today: 10-05 Class Notes CS 107 Wednesday, October 05, 2011 1:08 PM CS 107 Fall 2011 Page 1 Deep vs. Shallow copy of an object: Consider having an Employee class that itself has in instance of Date . Create a copy constructor for the Employee class. What happens to the Date? How can we do a deep comparison of objects? [ implement an equals(. .) method ] g. CS 107 Fall 2011 Page 2...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern