Assignment 3 - Info Hiding, Encap, Objs and Ref

Assignment 3 - Info Hiding, Encap, Objs and Ref - Dr....

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

View Full Document Right Arrow Icon
Dr. Karina V. Assiter 5a7d050e9d7a474c8bc54c3cbb4e67a3e54a088a.doc 5/11/2009 Wentworth Institute of Technology Object Oriented Programming Due: September 29, 2003 Topics: 1. Information Hiding 2. Encapsulation 3. Objects and Reference Instructions 1. Read sections 4.2 and 4.3 2. For your BaseballPlayer class from Assignment 2: a. Make all your instance variables private b. For each instance variable , add: i. Mutator method (ie, setName ( …)) ii. Accessor method (ie, getName()) c. Write a set method that sets all instance variables at once. d. Write a makeEqual method that sets the instance variables of the object to the values of the inputted object: public void makeEqual (BaseBallPlayer otherPlayer) e. Write an equals method that tests whether or not an object of the same type (passed in as a parameter) has the same values for all its instance variables: public Boolean equals (BaseBallPlayer otherPlayer) f. For each of the methods in your BaseballPlayer class, go back and add preconditions
Background image of page 1

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

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

This note was uploaded on 04/17/2008 for the course COMP SCI 201 taught by Professor Durga during the Spring '08 term at Wentworth Institute of Technology.

Page1 / 2

Assignment 3 - Info Hiding, Encap, Objs and Ref - Dr....

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