The moose likes Java in General and the fly likes java.lang.NumberFormatException: For input string: Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "java.lang.NumberFormatException: For input string: """ Watch "java.lang.NumberFormatException: For input string: """ New topic
Author

java.lang.NumberFormatException: For input string: ""

Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 672
Hello,

If month or year is null then the following code throws exception
java.lang.NumberFormatException: For input string: ""



Thanks in anticipation

Best regards
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 16687
    
  19


Not sure if there is a question here... but if you are asking if the parseInt() method throws a number format exception for empty strings, then "yes".

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Posts: 2066

If the passed String were not properly formatted, then NumberFormatException will be thrown. "" is not a properly formatted number.


|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: java.lang.NumberFormatException: For input string: ""
 
Similar Threads
Calculate date
Handling java.sql.Timestamp
exact date difference using Gregorian Calendar
Making String to java.util.Date
Problem with adding months to Gregorian Calender