How to print different Messge for the same NumberFormatException on different cause objects in JAVA?

Ads
 

How to print different Messge for the same NumberFormatException on different cause objects in JAVA?

How to print different Messge for the same NumberFormatException on different cause objects in JAVA?

try { int a=Integer.parseInt(aStr); int b= Integer.parseInt(bStr); }catch (NumberFormatException ex) { if ex's cause is from int a;//ex.getCause()=a? System.out.println("a is not a integer"); if ex's cause is from int b System.out.println("b is not a integer"); }

or 2 catch block, but how to complete it?

try { int a=Integer.parseInt(aStr); int b= Integer.parseInt(bStr); }catch (NumberFormatException ex) { if ex's cause is from int a;//ex.getCause()=a? System.out.println("a is not a integer");} catch (NumberFormatException ex){ if ex's cause is from int b System.out.println("b is not a integer"); } .

View Answers

Ads









Related Tutorials/Questions & Answers:
How to print different Messge for the same NumberFormatException on different cause objects in JAVA?
login for different user in the same page
Advertisements
How send different files to browser at same time ..example(pdf&html) want display in same request using servlet
how to get values for same column name from two different tables in SQL
inserting same data to different tables in oracle
inserting same data to different tables in oracle
inserting same data to different tables in oracle
inserting same data to different tables in oracle
inserting same data to different tables in oracle
inserting same data to different tables in oracle
different output trying to execute same java code
different output trying to execute same java code
different output trying to execute same java code
How to make a button of different behaviour?
how to communicate with different web applications - JSP-Servlet
How create an overlay button on different containing div
How to communicate with different web applications ? ? ? ? - JSP-Servlet
How to Explain different way of using thread?
How to Explain different way of using thread?
updating rows which contains same id, different value for each row
How to communicate with different web applications ? ? ? ? - JSP-Servlet
* How to communicate with different web applications ? ? ? ? - JSP-Servlet
*** How to communicate with different web applications ? ? ? ? - JSP-Servlet
Different JRE
difference between java5 and java6 - Java Beginners
How to resolve NumberFormatException(Unlnown Source)?
how to store array values into two different tables in java?
How to read text file to two different name array
How to read text file to two different name array
Java2
PHP Comparison Objects

Ads