Hi I am new to Java please can anybody explain the following code. And I replaced int with the Date type but the d1 value doesn't changed. But why the date is only changing and how the setYear(100) is print as 2000.
public static void main(String args[]){
Date d1 = new Date(99,11,31);
Date d2 = new Date(99,11,31);
changeDate(d1,d2);
System.out.println("d1: "+d1+" \nd2: "+d2);
}
static void changeDate(Date d1, Date d2){
d1.setYear(100);
d2 = d1;
}
d1 is Fri December 31 00:00:00 GMT 1999 d2 is Sun December 31 00:00:00 GMT 2000