Here all three Calendar.SECOND values are same. how? i am creating three different objects for each.
class sec {
public sec() {
GregorianCalendar cal2 = new GregorianCalendar();
int currentIndex2 = cal2.get(Calendar.SECOND);
System.out.println("constrctor..second2.."+currentIndex2);
}
public static void main(
String args[]) {
sec se = new sec();
GregorianCalendar cal = new GregorianCalendar();
int currentIndex = cal.get(Calendar.SECOND);
System.out.println("second.."+currentIndex);
GregorianCalendar cal1 = new GregorianCalendar();
int currentIndex1 = cal1.get(Calendar.SECOND);
System.out.println("second1.."+currentIndex1);
}
}