04-07feb01customizing - 1 1 CS100J 1 February 2007....

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 1 CS100J 1 February 2007. Customizing a class & testing Quote for the day: There is no reason anyone would want a computer in their home.--Ken Olson, founder of Digital Equipment Corp. (DEC), 1977. The company was a huge player in computer hardware and software in CS academia in the 1970s. The PDP machines were well known. The VAX had unix on it, and C, and Lisp. It was the main computer in most CS departments of any stature. DEC was bought by COMPAQ in the late 1990s. Quiz 2 on Tuesday: How do you evaluate a new expression (see slide 6)? What is the purpose of a constructor (see slide 5)? Fields (variables in a folder), and getter & setter methods . Secs 1.4.1 (p. 45) & 3.1 (pp. 105110 only) Constructors . Sec. 3.1.3 (p. 111112) Testing methods . Appendix I.2.4 (p. 486) 2 Field: a variable that is in each folder of a class. a0 Chapter title number previous public class Chapter { private String title; // Title of the chapter private int number; // Number of the chapter private Chapter previous; // previous chapter (null if none) } We generally make elds private instead of public , so that they cannot be referenced from methods that are outside the class. 3 Getter and setter methods a0 Chapter title number previous /** An instance describes a chapter of a book */ public class Chapter { private String title; // Title of the chapter /** = the title of the chapter */...
View Full Document

This note was uploaded on 03/03/2012 for the course CS 100J taught by Professor Davidgries during the Spring '07 term at Cornell University (Engineering School).

Page1 / 2

04-07feb01customizing - 1 1 CS100J 1 February 2007....

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online