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

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

View Full Document Right Arrow Icon
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 1970’s. 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 1990’s. 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. 105–110 only) Constructors . Sec. 3.1.3 (p. 111–112) Testing methods . Appendix I.2.4 (p. 486)
Background image of page 1

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

View Full DocumentRight Arrow Icon
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 fields private instead of public , so that they cannot be referenced from methods that are outside the class.
Background image of page 2
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 */ public String getTitle() { return title; }
Background image of page 3

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

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

Page1 / 10

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

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

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