RU beehive logo ITEC dept promo banner
ITEC 120
2012fall
dbraffitt
ibarland

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

lab13a
Objects containing Objects

Self-Test:

class Blarg {
  private int zzmph;
  // &vdots;
  // Other fields/methods omitted
  // &vdots;
  }
Write a getter and a setter for zzmph.

Also, we'll see motivation today for the following rule-of-thumb, about access modifiers (public and private):
Fields should be declared                 ; almost all methods should be declared                 .


We will develop a class to represent the Hideouts that Robots use while they try to hide their presence on Earth.
Initial source files: lect13a-hideout.jar; see how-to-get-jar-files-into-BlueJ—Downloading .jar files into BlueJ.
We won't turn in today's work, though it will practice the concepts that will be needed for the last hw.

Hideout.java (and one helper function (willBattleAnyOf) added to Robot.java)
Files/solution as completed in lecture: lect13a-sect04-hideout/.


1 In the past we've just called this “equals”, but here we decide that we want to allow for two Hideouts that look the same (are deepEquals) to actually be considered different (not equals) — like identical twins, who are not equals despite being deepEquals.      

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


©2012, Ian Barland, Radford University
Last modified 2012.Dec.04 (Tue)
Please mail any suggestions
(incl. typos, broken links)
to ibarlandradford.edu
Powered by PLT Scheme