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