java.lang

Class NullPointerException

Implemented Interfaces:
Serializable

public class NullPointerException
extends RuntimeException

Thrown when an application attempts to use null in a case where an object is required. These include:

Applications should throw instances of this class to indicate other illegal uses of the null object.

Since:
JDK1.0
See Also:
Serialized Form

Constructor Summary

NullPointerException()
Constructs a NullPointerException with no detail message.
NullPointerException(String s)
Constructs a NullPointerException with the specified detail message.

Method Summary

Methods inherited from class java.lang.Throwable

fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

NullPointerException

public NullPointerException()
Constructs a NullPointerException with no detail message.
Usages and Demos :

View More Examples of NullPointerException()
   1:   {
   2:     throw new NullPointerException();
   3:   }
   4: 
   5:   public static void main(String[] args) throws Throwable

View Full Code Here
   1:     if (name == null || valueClass == null)
   2:       throw new NullPointerException();
   3:     this.name = name;
   4:     this.valueClass = valueClass;
   5:   }

View Full Code Here
   1:     if (entityManager == null)
   2:       throw new NullPointerException();
   3:     this.entityManager = entityManager;
   4:         ...
   5:     if (locale == null)
   6:       throw new NullPointerException();
   7:     this.locale = locale;
   8:   }
   9: }

View Full Code Here
   1:     public void wrench() {
   2:         throw new NullPointerException();
   3:         
   4:     }

View Full Code Here
   1:     try {
   2:       throw new NullPointerException();
   3:     } catch(NullPointerException e) {
   4:       logException(e);
   5:     }

View Full Code Here

NullPointerException

public NullPointerException(String s)
Constructs a NullPointerException with the specified detail message.
Parameters:
s - the detail message.
Usages and Demos :

View More Examples of NullPointerException(String s)
   1:     if (adapter == null)
   2:       throw new NullPointerException("'submitFiling()' was called on a RemoteRmiCmsConnectorImpl with a null CmsAdapter.");
   3:     adapter.processFiling(filing);
   4:   }

View Full Code Here
   1:         if (ns == null) {
   2:             throw new NullPointerException("");
   3:         }
   4: 
   5:         prefix = ns.getPrefix();

View Full Code Here
   1:         b.addln("if (property == null)");
   2:         b.add("  throw new java.lang.NullPointerException(");
   3:         b.addQuoted(ImplMessages.servicePropertyWasNull(propertyName, targetService));
   4:         b.addln(");");

View Full Code Here
   1:     if (remoteID == null)
   2:       throw new NullPointerException("'getFilingByRemoteId()' was called with a null 'remoteID' value.");
   3:     InternalLxmlFiling filing = null;
   4:         ...
   5:     if (filingId == null)
   6:       throw new NullPointerException("'OzoneLxmlFilingManagerImpl.getFiling()' was passed a null filing ID.");
   7:     return (InternalLxmlFiling)(filingIdMap.get(filingId));
   8:         ...
   9:     if (filingId == null)
  10:       throw new NullPointerException("'OzoneLxmlFilingManagerImpl.removeFiling()' was passed a null filing ID.");
  11:     filingIdMap.remove(filingId);

View Full Code Here