Week8Chap5-III

Week8Chap5-III - • Constructor (s) of a class • Object...

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

View Full Document Right Arrow Icon
Janaka Balasooriya CSE 110, Arizona State University Chapter 5 Writing Classes - Summary
Background image of page 1

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

View Full DocumentRight Arrow Icon
Categorizing methods of a Class: Accessors and Mutators Because instance data is private, a class usually provides services to access and modify data values An accessor method returns the current value of a variable A mutator method changes the value of a variable The names of accessor and mutator methods take the form getX and setX , respectively, where X is the name of the value. (book use the name getter and setter to represent accessor and mutator methods)
Background image of page 2
Janaka Balasooriya CSE 110, Arizona State University Writing Classes: Summary Analyze the Object and Identify Methods and Attributes Draw the UML diagram to represent the Object Implement the class Use the class in your program Some of the important concepts • public vs. private members (attributes and methods) static vs. non static members Encapsulation • toString() method
Background image of page 3

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

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

Unformatted text preview: • Constructor (s) of a class • Object instances and instance related data • writing methods of a class • void methods • value returning methods Janaka Balasooriya CSE 110, Arizona State University Reading Assignment and Practice Questions Read Sections 5.1, 5.2, 5.3, 5.4, and 5.5 Review Lecture notes Practice Questions from the Book Self – Review Questions (You can find answers in the book) SR 5.1, 5.2, 5.3, 5.5, 5.13, 5.16, 5.17 Programming Questions PP 5.5 (here a getter method is a method that return a values, such as getter method for age is can be named as getAge() that returns the age of the age. Similarly, setter method set a values of a data member, such as getter method for age is can be named as setAge(int newAge), that sets the age) PP 5.6 Janaka Balasooriya CSE 110, Arizona State University Developing and Using Objects: activity...
View Full Document

This note was uploaded on 12/08/2010 for the course CSE 110 taught by Professor Kim during the Spring '08 term at ASU.

Page1 / 5

Week8Chap5-III - • Constructor (s) of a class • Object...

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

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