26 package java.lang;
27
28 /**
29 * Thrown when an application attempts to use {@code null} in a
30 * case where an object is required. These include:
31 * <ul>
32 * <li>Calling the instance method of a {@code null} object.
33 * <li>Accessing or modifying the field of a {@code null} object.
34 * <li>Taking the length of {@code null} as if it were an array.
35 * <li>Accessing or modifying the slots of {@code null} as if it
36 * were an array.
37 * <li>Throwing {@code null} as if it were a {@code Throwable}
38 * value.
39 * </ul>
40 * <p>
41 * Applications should throw instances of this class to indicate
42 * other illegal uses of the {@code null} object.
43 *
44 * {@code NullPointerException} objects may be constructed by the
45 * virtual machine as if {@linkplain Throwable#Throwable(String,
46 * Throwable, boolean) suppression were disabled}.
47 *
48 * @author unascribed
49 * @since JDK1.0
50 */
51 public
52 class NullPointerException extends RuntimeException {
53 private static final long serialVersionUID = 5162710183389028792L;
54
55 /**
56 * Constructs a {@code NullPointerException} with no detail message.
57 */
58 public NullPointerException() {
59 super();
60 }
61
62 /**
63 * Constructs a {@code NullPointerException} with the specified
64 * detail message.
65 *
66 * @param s the detail message.
|
26 package java.lang;
27
28 /**
29 * Thrown when an application attempts to use {@code null} in a
30 * case where an object is required. These include:
31 * <ul>
32 * <li>Calling the instance method of a {@code null} object.
33 * <li>Accessing or modifying the field of a {@code null} object.
34 * <li>Taking the length of {@code null} as if it were an array.
35 * <li>Accessing or modifying the slots of {@code null} as if it
36 * were an array.
37 * <li>Throwing {@code null} as if it were a {@code Throwable}
38 * value.
39 * </ul>
40 * <p>
41 * Applications should throw instances of this class to indicate
42 * other illegal uses of the {@code null} object.
43 *
44 * {@code NullPointerException} objects may be constructed by the
45 * virtual machine as if {@linkplain Throwable#Throwable(String,
46 * Throwable, boolean, boolean) suppression were disabled and/or the
47 * stack trace was not writable}.
48 *
49 * @author unascribed
50 * @since JDK1.0
51 */
52 public
53 class NullPointerException extends RuntimeException {
54 private static final long serialVersionUID = 5162710183389028792L;
55
56 /**
57 * Constructs a {@code NullPointerException} with no detail message.
58 */
59 public NullPointerException() {
60 super();
61 }
62
63 /**
64 * Constructs a {@code NullPointerException} with the specified
65 * detail message.
66 *
67 * @param s the detail message.
|