| Author |
difference between getInstance() and getDateInstance()
|
Ben Zaidi
Ranch Hand
Joined: Apr 08, 2007
Posts: 151
|
|
Hi All,
I was looking forward to know what's the main difference between these two methods of DateFormat class
getInstance()
getDateInstance()
Can someone tell me any difference, because both appear to work the same way.
Ben
|
Ben,
--Lost in preparation of SCJP and SCWCD--
"Start writing a new chapter, for if you live by the book you'll never make history." (Ben Sobel)
|
 |
Ankit Garg
Saloon Keeper
Joined: Aug 03, 2008
Posts: 9189
|
|
Well getDateInstance and getInstance are mostly the same. But there is overloaded version of getDateInstance which can take parameter but getInstance is not overloaded to take parameters. Here's the docs for the no parameter version of both the methods
public static final DateFormat getInstance()
Get a default date/time formatter that uses the SHORT style for both the date and the time.
public static final DateFormat getDateInstance()
Gets the date formatter with the default formatting style for the default locale.
|
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
|
 |
 |
I agree. Here's the link: jrebel
|
|
subject: difference between getInstance() and getDateInstance()
|
|
|