When should a method be static?
Neither reads from nor writes to instance fields
Independent of the state of the object
Mathematical methods that accept arguments, apply an algorithm to those arguments, and return a value
Factory methods that serve in lieu of constructors
Previous
|
Next
|
Top
|
Cafe au Lait
Copyright 2003 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified September 30, 2003