File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes DateFormat.isLenient() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "DateFormat.isLenient()" Watch "DateFormat.isLenient()" New topic


Viet Jav
Ranch Hand

Joined: Dec 27, 2001
Posts: 55
Please explain usage method isLenient() in package java.text.DateFormat; and if possible give me a code about this method.
Lam nguyen.
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
By default isLenient() is true which means that if the String in the parse() method isn't exactly in the right format it will still try to get a date from it. If setLenient(false) then the string must be in exactly the format defined by the DateFormat object.

Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
I agree. Here's the link:
subject: DateFormat.isLenient()
It's not a secret anymore!