< prev index next >
src/java.base/share/classes/java/lang/NumberFormatException.java
Print this page
*** 59,70 ****
* Factory method for making a {@code NumberFormatException}
* given the specified input which caused the error.
*
* @param s the input causing the error
*/
! static NumberFormatException forInputString(String s) {
! return new NumberFormatException("For input string: \"" + s + "\"");
}
/**
* Factory method for making a {@code NumberFormatException}
* given the specified input which caused the error.
--- 59,73 ----
* Factory method for making a {@code NumberFormatException}
* given the specified input which caused the error.
*
* @param s the input causing the error
*/
! static NumberFormatException forInputString(String s, int radix) {
! return new NumberFormatException("For input string: \"" + s + "\"" +
! (radix == 10 ?
! "" :
! " under radix " + radix));
}
/**
* Factory method for making a {@code NumberFormatException}
* given the specified input which caused the error.
< prev index next >