What will be the output of following quiz that parses a String to Number using NumberFormat ?
parse() method in NumberFormat parses text from the beginning of the given string to produce a number. The method may not use the entire text of the given string.
It will throw an exception if beginning of a string can’t be parsed.
For example, it will throw ParseException for string A123xyz456
Correct answer is “123”
© 2016, www.topjavatutorial.com. All rights reserved. On republishing this post, you must provide link to original post