Re: DateFormat question
- From: Tom Hawtin <usenet@xxxxxxxxxxxxxxxxx>
- Date: Thu, 31 May 2007 20:32:58 +0100
Daniel Dyer wrote:
just be that you get an instance of SimpleDateFormat, which is a public class that you can instantiate directly. I don't know exactly which type is returned, but the idea is that you don't need to know. If you are curious, you can call getClass() on the object returned and print out its type.
It's not entirely true that you don't need to know. If you want to do some constrained input you need to more information than DateFormat, so casting to SimpleDateFormat would be useful. Also if you serialise it, you need to know whether you can deserialise it, and whether you are likely to be able to deserialise it on other machines.
(IIRC, Sun's DateFormat implementation always returns SimpleDateFormat instances, currently.)
Tom Hawtin
.
- Follow-Ups:
- Re: DateFormat question
- From: Daniel Dyer
- Re: DateFormat question
- References:
- DateFormat question
- From: hrosser
- Re: DateFormat question
- From: Daniel Dyer
- DateFormat question
- Prev by Date: Re: DateFormat question
- Next by Date: Re: Overriding Generics
- Previous by thread: Re: DateFormat question
- Next by thread: Re: DateFormat question
- Index(es):