NullPointerException.java revision 0
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel/*
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel * Copyright 1994-1997 Sun Microsystems, Inc. All Rights Reserved.
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e217869edbae075c18fd85c2d468a7ce9050b3b3Jake Feasel *
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel * This code is free software; you can redistribute it and/or modify it
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel * under the terms of the GNU General Public License version 2 only, as
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel * published by the Free Software Foundation. Sun designates this
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel * particular file as subject to the "Classpath" exception as provided
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel * by Sun in the LICENSE file that accompanied this code.
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel *
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel * This code is distributed in the hope that it will be useful, but WITHOUT
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel * version 2 for more details (a copy is included in the LICENSE file that
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel * accompanied this code).
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel *
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel * You should have received a copy of the GNU General Public License version
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel * 2 along with this work; if not, write to the Free Software Foundation,
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel *
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel * CA 95054 USA or visit www.sun.com if you need additional information or
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel * have any questions.
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel */
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feaselpackage java.lang;
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel
d1a2899a06be1eab885056aeda85adcd67c010b0Jason Browne/**
d1a2899a06be1eab885056aeda85adcd67c010b0Jason Browne * Thrown when an application attempts to use <code>null</code> in a
433f48af5998e03a03440dce699c9dcfd7b86375Jason Browne * case where an object is required. These include:
540772c380f0a368687ce285f9b915e0affec03dhuck.elliott * <ul>
d64a1b8fb5da22f61ec70398ba83a80b8efa46a2Jason Browne * <li>Calling the instance method of a <code>null</code> object.
67c044a145fa1987d77d3f609876a839b0240ed0Jason Browne * <li>Accessing or modifying the field of a <code>null</code> object.
e3cca5e1f9f9a55839d4bd7d34f51145f835a7b8Jason Browne * <li>Taking the length of <code>null</code> as if it were an array.
67c044a145fa1987d77d3f609876a839b0240ed0Jason Browne * <li>Accessing or modifying the slots of <code>null</code> as if it
08b5793948544288f007d40b3391a6f69e2aeb07huck.elliott * were an array.
08b5793948544288f007d40b3391a6f69e2aeb07huck.elliott * <li>Throwing <code>null</code> as if it were a <code>Throwable</code>
e3cca5e1f9f9a55839d4bd7d34f51145f835a7b8Jason Browne * value.
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel * </ul>
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel * <p>
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel * Applications should throw instances of this class to indicate
c6acaf789531718f174a4fc5b87aaed163b861dbJason Browne * other illegal uses of the <code>null</code> object.
c6acaf789531718f174a4fc5b87aaed163b861dbJason Browne *
c6acaf789531718f174a4fc5b87aaed163b861dbJason Browne * @author unascribed
e217869edbae075c18fd85c2d468a7ce9050b3b3Jake Feasel * @since JDK1.0
c6acaf789531718f174a4fc5b87aaed163b861dbJason Browne */
d1a2899a06be1eab885056aeda85adcd67c010b0Jason Brownepublic
7ed4684789d023e1d4ede1b0d4468b9724587466Elizabeth Browneclass NullPointerException extends RuntimeException {
d64a1b8fb5da22f61ec70398ba83a80b8efa46a2Jason Browne /**
e3cca5e1f9f9a55839d4bd7d34f51145f835a7b8Jason Browne * Constructs a <code>NullPointerException</code> with no detail message.
c6acaf789531718f174a4fc5b87aaed163b861dbJason Browne */
c6acaf789531718f174a4fc5b87aaed163b861dbJason Browne public NullPointerException() {
67c044a145fa1987d77d3f609876a839b0240ed0Jason Browne super();
67c044a145fa1987d77d3f609876a839b0240ed0Jason Browne }
08b5793948544288f007d40b3391a6f69e2aeb07huck.elliott
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel /**
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel * Constructs a <code>NullPointerException</code> with the specified
01a229e011c0d84be34e967cf517d35a476c541aJake Feasel * detail message.
*
* @param s the detail message.
*/
public NullPointerException(String s) {
super(s);
}
}