This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 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!