public class NullPointerException extends RuntimeException
null时抛出。
这些包括:
null对象的实例方法。 null对象的字段。 null的长度,好像是一个数组。 null就好像它是一个数组。 null好像是一个Throwable价值。 应用程序应该抛出此类的实例以指示null对象的其他非法使用。 NullPointerException对象可以由虚拟机构建,就像suppression were disabled and/or the stack trace was not writable一样 。
| Constructor and Description |
|---|
NullPointerException()
构造一个没有详细消息的
NullPointerException 。
|
NullPointerException(String s)
构造具有
NullPointerException详细消息的NullPointerException。
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic NullPointerException()
NullPointerException 。
public NullPointerException(String s)
NullPointerException详细消息的NullPointerException。
s - 详细信息。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.