Q:

Java - Exception Handling(NumberFormatException)

0

This Program is used to demonstrate Exception Handling-NumberFormatException concept.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

// NumberFormatException 

class NumEx 
{ 
public static void main(String args[]) 
{ 
try 
{ 
int a = Integer.parseInt ("Senthil") ; 
System.out.println(a); 
} 
catch(NumberFormatException e) 
{ 
System.out.println("\nNumberFormatException : String declared in int data type"); 
} 
} 
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now