How to avoid Number Format Exception in java? [duplicate]
问题 This question already has answers here : What is a NumberFormatException and how can I fix it? [duplicate] (9 answers) Closed 3 years ago . In my day to day web application development there are many instances where we need to take some number inputs from the user. Then pass on this number input to may be service or DAO layer of the application. At some stage since its a number (integer or float), we need to convert it into Integer as shown in the following code snippet. String cost = request