// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;

public class TestCalendar {
    private static DateFormat df = new SimpleDateFormat("MMMM d y G");
    public static void main(String[] args) {
        Calendar cal = Calendar.getInstance();
        System.out.println(cal.getClass().getName());
        cal.set(Calendar.YEAR, 1);
        System.out.println(df.format(cal.getTime()));
        System.out.println(cal.get(Calendar.YEAR));
        cal.add(Calendar.YEAR, -1);
        System.out.println(df.format(cal.getTime()));
        System.out.println(cal.get(Calendar.YEAR));
    }
}
