1. /*
  2. * @(#)NumberFormatException.java 1.19 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.lang;
  8. /**
  9. * Thrown to indicate that the application has attempted to convert
  10. * a string to one of the numeric types, but that the string does not
  11. * have the appropriate format.
  12. *
  13. * @author unascribed
  14. * @version 1.19, 01/23/03
  15. * @see java.lang.Integer#toString()
  16. * @since JDK1.0
  17. */
  18. public
  19. class NumberFormatException extends IllegalArgumentException {
  20. static final long serialVersionUID = -2848938806368998894L;
  21. /**
  22. * Constructs a <code>NumberFormatException</code> with no detail message.
  23. */
  24. public NumberFormatException () {
  25. super();
  26. }
  27. /**
  28. * Constructs a <code>NumberFormatException</code> with the
  29. * specified detail message.
  30. *
  31. * @param s the detail message.
  32. */
  33. public NumberFormatException (String s) {
  34. super (s);
  35. }
  36. /**
  37. * Factory method for making a <code>NumberFormatException</code>
  38. * given the specified input which caused the error.
  39. *
  40. * @param s the input causing the error
  41. */
  42. static NumberFormatException forInputString(String s) {
  43. return new NumberFormatException("For input string: \"" + s + "\"");
  44. }
  45. }