1. /*
  2. * @(#)NullPointerException.java 1.16 00/02/02
  3. *
  4. * Copyright 1994-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package java.lang;
  11. /**
  12. * Thrown when an application attempts to use <code>null</code> in a
  13. * case where an object is required. These include:
  14. * <ul>
  15. * <li>Calling the instance method of a <code>null</code> object.
  16. * <li>Accessing or modifying the field of a <code>null</code> object.
  17. * <li>Taking the length of <code>null</code> as if it were an array.
  18. * <li>Accessing or modifying the slots of <code>null</code> as if it
  19. * were an array.
  20. * <li>Throwing <code>null</code> as if it were a <code>Throwable</code>
  21. * value.
  22. * </ul>
  23. * <p>
  24. * Applications should throw instances of this class to indicate
  25. * other illegal uses of the <code>null</code> object.
  26. *
  27. * @author unascribed
  28. * @version 1.16, 02/02/00
  29. * @since JDK1.0
  30. */
  31. public
  32. class NullPointerException extends RuntimeException {
  33. /**
  34. * Constructs a <code>NullPointerException</code> with no detail message.
  35. */
  36. public NullPointerException() {
  37. super();
  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. }