This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
If you want parseFloat method to throw an error, then you have to pass a string which cannot be parsed to a number like "abc". Since you have passed 23d, which is parsed into 23.0d (a double), there was no error.
Joined: Nov 23, 2008
With the above code, I would like to check validity of text entered into a text field of a java AWT application