Source Home >> Java Source 1.6.0 >> java.lang.NullPointerException V 0.09
  • 01/*
  • 02 * @(#)NullPointerException.java 1.20 05/11/17
  • 03 *
  • 04 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
  • 05 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  • 06 */
  • 07
  • 08package java.lang;
  • 09
  • 10/**
  • 11 * Thrown when an application attempts to use <code>null</code> in a
  • 12 * case where an object is required. These include:
  • 13 * <ul>
  • 14 * <li>Calling the instance method of a <code>null</code> object.
  • 15 * <li>Accessing or modifying the field of a <code>null</code> object.
  • 16 * <li>Taking the length of <code>null</code> as if it were an array.
  • 17 * <li>Accessing or modifying the slots of <code>null</code> as if it
  • 18 * were an array.
  • 19 * <li>Throwing <code>null</code> as if it were a <code>Throwable</code>
  • 20 * value.
  • 21 * </ul>
  • 22 * <p>
  • 23 * Applications should throw instances of this class to indicate
  • 24 * other illegal uses of the <code>null</code> object.
  • 25 *
  • 26 * @author unascribed
  • 27 * @version 1.20, 11/17/05
  • 28 * @since JDK1.0
  • 29 */
  • 30public
  • 31class NullPointerException extends RuntimeException {
  • 32 /**
  • 33 * Constructs a <code>NullPointerException</code> with no detail message.
  • 34 */
  • 35 public NullPointerException() {
  • 36 super();
  • 37 }
  • 38
  • 39 /**
  • 40 * Constructs a <code>NullPointerException</code> with the specified
  • 41 * detail message.
  • 42 *
  • 43 * @param s the detail message.
  • 44 */
  • 45 public NullPointerException(String s) {
  • 46 super(s);
  • 47 }
  • 48}

文件:NullPointerException.java
包名:java.lang
类名:NullPointerException
继承:RuntimeException
接口: