There's a new ppt in the Handout folder called ICS4M_03_InstanceClass.ppt. It deals with instance and class variables and instance and class methods. You can look at pp 184 and 184 of your text for some clarification. As always Google is you r friend for a quick and dirty take on what these concepts mean. Try something like "java instance variabl" or "java instance vs class variable"
We worked on the two Review exercises on page 185 in class and I asked those who were here to complete them at home if they didn't get it done in class.
With respec to instance and class variables remember this:
Instance variables are created with objects when the objects are instantiated. You should understand them as part of the object itself. That means that there's one copy of the instance variable for every object that gets created.
Class variables are part of the class itself. This means that there's just one for the whole class and all objects instantiated from the class use that same variable.
How do we tell the difference between an instance and a class variable? A class variable is declared using the keyword static.
Tuesday, February 10, 2009
Subscribe to:
Post Comments (Atom)

First
ReplyDeleteSecond
ReplyDeleteThere's a lot of spelling mistakes here.
ReplyDelete- Google is you r friend for a quick
- "java instance variabl"
- With respec to instance and class variables remember this
lern2spallcheque
ReplyDeleteThe system is down yo!
ReplyDeleteThere's been no blog for a while... did blogger die?
ReplyDelete