Most visited

Recently visited

Added in API level 1

NullPointerException

public class NullPointerException
extends RuntimeException

java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ java.lang.RuntimeException
         ↳ java.lang.NullPointerException


当应用程序尝试在需要对象的情况下使用null时抛出。 这些包括:

应用程序应该抛出此类的实例来指示null对象的其他非法使用。 NullPointerException对象可以由虚拟机构造,就像suppression were disabled and/or the stack trace was not writable一样

Summary

Public constructors

NullPointerException()

构造一个没有详细信息的 NullPointerException

NullPointerException(String s)

用指定的详细信息构造一个 NullPointerException

Inherited methods

From class java.lang.Throwable
From class java.lang.Object

Public constructors

NullPointerException

Added in API level 1
NullPointerException ()

构造一个没有详细信息的 NullPointerException

NullPointerException

Added in API level 1
NullPointerException (String s)

用指定的详细信息构造一个 NullPointerException

Parameters
s String: the detail message.

Hooray!