public class NullPointerException
extends RuntimeException
java.lang.Object | ||||
↳ | java.lang.Throwable | |||
↳ | java.lang.Exception | |||
↳ | java.lang.RuntimeException | |||
↳ | java.lang.NullPointerException |
当应用程序尝试在需要对象的情况下使用null
时抛出。 这些包括:
null
object. null
object. null
as if it were an array. null
as if it were an array. null
as if it were a Throwable
value. 应用程序应该抛出此类的实例来指示null
对象的其他非法使用。 NullPointerException
对象可以由虚拟机构造,就像suppression were disabled and/or the stack trace was not writable一样 。
Public constructors |
|
---|---|
NullPointerException() 构造一个没有详细信息的 |
|
NullPointerException(String s) 用指定的详细信息构造一个 |
Inherited methods |
|
---|---|
From class java.lang.Throwable
|
|
From class java.lang.Object
|
NullPointerException ()
构造一个没有详细信息的 NullPointerException
。
NullPointerException (String s)
用指定的详细信息构造一个 NullPointerException
。
Parameters | |
---|---|
s |
String : the detail message. |