Google News
logo
Java - Interview Questions
What happens if a string “Hello” is passed to parseInt() method?
Ideally, a string with an integer value should be passed to parseInt() method. So, on passing “Hello” an exception called “NumberFormatException” occurs since the parseInt() method cannot convert the given string “Hello” into an integer value.
Advertisement