Most visited

Recently visited

Added in API level 1

IllegalArgumentException

public class IllegalArgumentException
extends RuntimeException

java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ java.lang.RuntimeException
         ↳ java.lang.IllegalArgumentException
Known Direct Subclasses
Known Indirect Subclasses


抛出以表明某个方法已通过非法或不恰当的参数。

也可以看看:

Summary

Public constructors

IllegalArgumentException()

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

IllegalArgumentException(String s)

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

IllegalArgumentException(String message, Throwable cause)

用指定的详细信息和原因构造一个新的异常。

IllegalArgumentException(Throwable cause)

构造具有指定的原因和 (cause==null ? null : cause.toString())详细消息(它通常包含的 cause类和详细消息)的新异常。

Inherited methods

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

Public constructors

IllegalArgumentException

Added in API level 1
IllegalArgumentException ()

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

IllegalArgumentException

Added in API level 1
IllegalArgumentException (String s)

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

Parameters
s String: the detail message.

IllegalArgumentException

Added in API level 1
IllegalArgumentException (String message, 
                Throwable cause)

用指定的详细信息和原因构造一个新的异常。

请注意,与 cause相关的详细消息 不会自动包含在此例外的详细消息中。

Parameters
message String: the detail message (which is saved for later retrieval by the getMessage() method).
cause Throwable: the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)

IllegalArgumentException

Added in API level 1
IllegalArgumentException (Throwable cause)

构造具有指定的原因和(cause==null ? null : cause.toString())详细消息(它通常包含的cause类和详细消息)的新异常。 此构造函数对于比其他throwables的包装稍微多些的异常(例如, PrivilegedActionException )非常有用。

Parameters
cause Throwable: the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)

Hooray!