KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > lang > NumberFormatException


1 /*
2  * @(#)NumberFormatException.java 1.20 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package java.lang;
9
10 /**
11  * Thrown to indicate that the application has attempted to convert
12  * a string to one of the numeric types, but that the string does not
13  * have the appropriate format.
14  *
15  * @author unascribed
16  * @version 1.20, 12/19/03
17  * @see java.lang.Integer#toString()
18  * @since JDK1.0
19  */

20 public
21 class NumberFormatException extends IllegalArgumentException JavaDoc {
22     static final long serialVersionUID = -2848938806368998894L;
23
24     /**
25      * Constructs a <code>NumberFormatException</code> with no detail message.
26      */

27     public NumberFormatException () {
28     super();
29     }
30
31     /**
32      * Constructs a <code>NumberFormatException</code> with the
33      * specified detail message.
34      *
35      * @param s the detail message.
36      */

37     public NumberFormatException (String JavaDoc s) {
38     super (s);
39     }
40
41     /**
42      * Factory method for making a <code>NumberFormatException</code>
43      * given the specified input which caused the error.
44      *
45      * @param s the input causing the error
46      */

47     static NumberFormatException JavaDoc forInputString(String JavaDoc s) {
48         return new NumberFormatException JavaDoc("For input string: \"" + s + "\"");
49     }
50 }
51
Popular Tags