Class vs. instance fields
static field
- System.out.println(Time.AM);
- Time is a class; AM is a class field
instance field
- Time t=new Time();
- t.sec=37;
- t is an instance of Time, an object of type Time
- sec is field of this instance
- Time s=new Time(); s.sec=52; // another instance!
- System.out.println(t.AM); // also valid
static string AMString = "AM";