BOOK NOTES CHAPTER 9 - STATIC 9.6 STATIC METHODS - static/class method: not invoked on an object - instance methods operate on a particular instance of a class - motivation: encapsulate computation that involves only numbers (which can't invoke methods) - call: use the name of the class instead of the name of the object - main must be static because there are no objects when the program starts - declare with the static modifier - minimize use of static methods 9.7 STATIC FIELDS - store values outside a particular object - single value that is the same for the entire class - declare with the static modifier - aka class field - every method of a class can access static fields of the same class - initialze when declare - created when class is loaded - always declare private (unless a constant) - minimize use of static fields