Instantiable Classes: static vs instance

static members of a class are fields and methods that have the keyword static as a modifier preceding the type of field or method.  Local variables (variables declared within methods) may not be declared static.  Constructors may not be declared static.

static fields

Fields that should be declared static

instance fields

Fields that should NOT be declared static

static methods (a.k.a. class methods)

instance methods (a.k.a. non-static methods)

 

© 2014 Debra Deppeler, All rights reserved.