Arne said:
I repeat: you can not instantiate an abstract class.
And I repeat: it should be concrete. We don't have an abstract
StringBuilder and a bunch of polymorphic StringBuilder subclasses, even
though string encodings and characters and presentation are often
heavily locale-dependent, so why an abstract and polymorphic date
builder type?
The only explanation I can think of, besides sheer perversity, is
because they gave one class multiple responsibilities.
Sure it is.
Its primary use are to get local specific interpretation and
modifications of date objects.
You can get that by adding the time zone offset to the time, for
Chrissake, and using a suitable DateFormat when converting to and from
user-visible or -supplied strings.
No. Everyone that read the documentation will of course set those
as well (if needed in the context).
Except that the set method doesn't let you. It only has the six
arguments years, months, days, hours, minutes, and seconds. So the natural
Calendar c = Calendar.getInstance();
c.set(yy,mm,dd,h,m,s);
Date d = c.getTime();
results in a date with a seemingly-random component when really the
above should suffice to yield a Date object dependent solely upon yy,
mm, dd, h, m, and s. Instead, to get such a Date object apparently
requires extra effort of some kind.
And that, by itself, is sufficient to demonstrate conclusively that a
design flaw exists.
So your continuing to argue with me (and even to get quite hostile!)
regarding whether or not such a flaw exists is pointless and stupid. It
exists. It is as plain as the nose on your face. I don't know why you
continue to deny it. A misguided knee-jerk impulse to defend Java
whenever it is criticized, however constructively?
I don't know and I don't really care, either. Please stop repeating
yourself, please stop attacking other people and not merely
dispassionately discussing Java, and please stop cluttering up this
thread and this newsgroup with pointless bickering.