Professional Documents
Culture Documents
Example of Try-Catch Blocks To Handle .: Numberformatexception
Example of Try-Catch Blocks To Handle .: Numberformatexception
Example of Try-Catch Blocks To Handle .: Numberformatexception
Output
$$$$789:S; e4ec. 7ava 24cept<lass &teration =. input is Hello and #ar Heel Sorr-, "Hello" is not an integer' #r- again $67ava'lang'0umber3ormat24ception. 3or input string. "Hello" 7ava'lang'0umber3ormat24ception. 3or input string. "Hello" at 7ava'lang'0umber3ormat24ception'*or&nputString(0umber3ormat24ception'7ava. >) at 7ava'lang'&nteger'parse&nt(&nteger'7ava. ?>) at 7ava'lang'&nteger'parse&nt(&nteger'7ava.@1>) at 24cept<lass'main(24cept<lass'7ava.1A) &teration 1. input is 23 and Strongbad Sorr-, "Strongbad" is not an integer' #r- again $67ava'lang'0umber3ormat24ception. 3or input string. "Strongbad" 7ava'lang'0umber3ormat24ception. 3or input string. "Strongbad" at 7ava'lang'0umber3ormat24ception'*or&nputString(0umber3ormat24ception'7ava. >) at 7ava'lang'&nteger'parse&nt(&nteger'7ava. ?>) at 7ava'lang'&nteger'parse&nt(&nteger'7ava.@1>) at 24cept<lass'main(24cept<lass'7ava.21) &teration 2. input is 2 and 123 0umbers are 2 and 123 ' $$$$789:S;. operation complete'