/** * Title: ObjCount * Description: demo of static fields and finalize * @author hollingd@cs.rpi.edu */ public class ObjCount { // static fields keep track of the next id number // and the total number of object that exist. static int next_id=0; static int objcount; // id is an instance field, each object has it's own. int id; // no exception handling (for brevity), but there should be! public static void main(String[] args) { int n = Integer.parseInt(args[0]); for (int i=0;i