CS231 (Sp03) Review Topics for Exam 1
Exam date: Thursday Feb 20, 2003
Additional Facts you need to know:
- Information is stored in variables
- Variables must be declared
- To declare a variable you write a type followed by an identifier
- Variables have 3 attributes: name, type, and value
- The name and type are specified in the declaration
- The value is variable (!) and is set only by assignment
statements
- Variables inside objects are called instance variables (because
there is one for each instance of the class (i.e. one for each object
of that type))
- Instance variables are autoinitialized to 0
- You may initialize them to something else by default
- To access instance variables from outside an object (i.e. from
another object), you use accessors.
- There are two kinds of parameters, formal (variables), and actual
(values).
- When you define a method you declare formal parameters.
- When you send a message, you include actual parameters (they have
actual values)
- Action is performed by sending messages to objects (including
optional parameters if more information is needed)
- You must create an object before you can send it messages.
[top]
[CS 231 Lectures Page]