import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class DateDemo {
public static void main(String[] args) throws ParseException {
SimpleDateFormat datef = new SimpleDateFormat("dd/mm/yyyy");
Date date1 = new Date(2010, 03, 03) ;
Date date2 = datef.parse("03/03/2010") ;
System.out.println( date1 );
System.out.println( date2 );
}
}
is giving following output:
Sun Apr 03 00:00:00 MST 3910 Sun Jan 03 00:03:00 MST 2010
Why it is giving different results?