home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / jbuilder / unsupported / JDK1.2beta3 / SOURCE / SRC.ZIP / java / lang / NullPointerException.java < prev    next >
Encoding:
Java Source  |  1998-03-20  |  1.6 KB  |  56 lines

  1. /*
  2.  * @(#)NullPointerException.java    1.13 98/03/18
  3.  *
  4.  * Copyright 1994-1997 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.lang;
  16.  
  17. /**
  18.  * Thrown when an application attempts to use <code>null</code> in a 
  19.  * case where an object is required. These include: 
  20.  * <ul>
  21.  * <li>Calling the instance method of a <code>null</code> object. 
  22.  * <li>Accessing or modifying the field of a <code>null</code> object. 
  23.  * <li>Taking the length of <code>null</code> as if it were an array. 
  24.  * <li>Accessing or modifying the slots of <code>null</code> as if it 
  25.  *     were an array. 
  26.  * <li>Throwing <code>null</code> as if it were a <code>Throwable</code> 
  27.  *     value. 
  28.  * </ul>
  29.  * <p>
  30.  * Applications should throw instances of this class to indicate 
  31.  * other illegal uses of the <code>null</code> object. 
  32.  *
  33.  * @author  unascribed
  34.  * @version 1.13, 03/18/98
  35.  * @since   JDK1.0
  36.  */
  37. public
  38. class NullPointerException extends RuntimeException {
  39.     /**
  40.      * Constructs a <code>NullPointerException</code> with no detail message.
  41.      */
  42.     public NullPointerException() {
  43.     super();
  44.     }
  45.  
  46.     /**
  47.      * Constructs a <code>NullPointerException</code> with the specified 
  48.      * detail message. 
  49.      *
  50.      * @param   s   the detail message.
  51.      */
  52.     public NullPointerException(String s) {
  53.     super(s);
  54.     }
  55. }
  56.