|
home—info—lects—labs—exams—hws
tutor/PIs—breeze (snow day)
Object120 + its docs—java.lang docs—java.util docs
- 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 “
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
home—info—lects—labs—exams—hws
tutor/PIs—breeze (snow day)
Object120 + its docs—java.lang docs—java.util docs
©2010, Ian Barland, Radford University Last modified 2010.Dec.07 (Tue) |
Please mail any suggestions (incl. typos, broken links) to ibarlandradford.edu |