RU beehive logo ITEC dept promo banner
ITEC 120
2010fall
ibarland

homeinfolectslabsexamshws
tutor/PIsbreeze (snow day)
Object120 + its docsjava.lang docsjava.util docs

lect07b
data design with objects

- Reading: §4.1-4.5 (overview of classes, fields, functions("methods"));
      §5.3 (equality and comparison)
- review:
  - exam info
  
  - mutating objects (setting a field) --
    functions which change an object have a return type of                 
  - static fields / named constants; 
  - meaning of 'static', 
  - purpose of constructor

To Teacher:: THIS LECTURE DIDN'T WORK. For starters, move it a bit later, after they've seen a few more classes? (Or maybe I was just off, today.)

For each fo the following, how would we represent them in Java? If you use a class, then include (a) what fields they'd have, and (b) what functions we might have that use them (give signatures). (And some fields we may not be sure how we'd represent — in that case we'll just make up a type like “GeographicRegion” or so.)

Also: should these objects be mutable? (That is, should "same" object change over time ?)

Note: Two notions of equality:

Note: The name of your class should be a singular noun. So if you are representing race results, you might have class RaceResult: One object (instance) of this class represents one result, so use singular.

homeinfolectslabsexamshws
tutor/PIsbreeze (snow day)
Object120 + its docsjava.lang docsjava.util docs


©2010, Ian Barland, Radford University
Last modified 2010.Dec.07 (Tue)
Please mail any suggestions
(incl. typos, broken links)
to iba�rlandrad�ford.edu
Powered by PLT Scheme