CS141: Topics for Week 9: Oct 19, 21, 23, 2015
Computer Science Headlines
ACM Tech News
Due Monday: Lab 6: Introduction to
Graphical User Interfaces
Begin: Lab 7: More on Classes
Static (or class) member variables (fields)
Static (or class) methods
Method signature (name + parameter types)
Reference to an object
Pass by value (primitive types)
Pass by reference (objects)
Comparing objects (.equals)
Deep vs shallow copying
"this" reference variable
(private) Inner class
- Object references
- Objects as method parameters and return types: Pass by Reference (not Pass by Value)
null keyword and Null Pointer Exceptions
- Self referencing using the keyword
- Overloading: Methods with the same name but a different list of parameter types
- Class (static) methods and variables - class methods can only access class variables
- Writing your own .equals method. Need to do this if you want to
compare objects which contains instances of other objects (aggregation).
Also consider the compareTo() method and the Comparable interface.
- Deep copying - don't create a copy using references of the member variables.
Also, when returning a member variable, it can be safer to return a copy and not the
- Enumeration Type Example
- See list of common errors on p. 435 of your text.
In Class Practice Activities