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.
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