Which method constructor constructs a new exception with the specified detail message and cause?

RuntimeException Constructors

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

In this article

Overloads

RuntimeException()

Constructs a new runtime exception with null as its detail message.

RuntimeException(Throwable)

Constructs a new runtime exception with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause).

RuntimeException(String)

Constructs a new runtime exception with the specified detail message.

RuntimeException(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

RuntimeException(String, Throwable)

Constructs a new runtime exception with the specified detail message and cause.

RuntimeException(String, Throwable, Boolean, Boolean)

Obsolete.

RuntimeException()

Constructs a new runtime exception with null as its detail message.

[Android.Runtime.Register(".ctor", "()V", "")] public RuntimeException (); Attributes

RegisterAttribute

Remarks

Java documentation for java.lang.RuntimeException.RuntimeException().

Portions of this page are modifications based on work created andshared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

RuntimeException(Throwable)

Constructs a new runtime exception with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause).

[Android.Runtime.Register(".ctor", "(Ljava/lang/Throwable;)V", "")] public RuntimeException (Java.Lang.Throwable? cause); [<Android.Runtime.Register(".ctor", "(Ljava/lang/Throwable;)V", "")>] new Java.Lang.RuntimeException : Java.Lang.Throwable -> Java.Lang.RuntimeException

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.)

Attributes

RegisterAttribute

Remarks

Java documentation for java.lang.RuntimeException.RuntimeException(java.lang.Throwable).

Portions of this page are modifications based on work created andshared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

RuntimeException(String)

Constructs a new runtime exception with the specified detail message.

[Android.Runtime.Register(".ctor", "(Ljava/lang/String;)V", "")] public RuntimeException (string? message); [<Android.Runtime.Register(".ctor", "(Ljava/lang/String;)V", "")>] new Java.Lang.RuntimeException : string -> Java.Lang.RuntimeException

Parameters

message String

the detail message. The detail message is saved for later retrieval by the #getMessage() method.

Attributes

RegisterAttribute

Remarks

Java documentation for java.lang.RuntimeException.RuntimeException(java.lang.String).

Portions of this page are modifications based on work created andshared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

RuntimeException(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

protected RuntimeException (IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer); new Java.Lang.RuntimeException : nativeint * Android.Runtime.JniHandleOwnership -> Java.Lang.RuntimeException

Parameters

javaReference IntPtr

nativeint

A IntPtrcontaining a Java Native Interface (JNI) object reference.

transfer JniHandleOwnership

A JniHandleOwnershipindicating how to handle javaReference

Remarks

Portions of this page are modifications based on work created andshared by the Android Open Source Projectand used according to terms described in theCreative Commons 2.5 Attribution License.

Applies to

RuntimeException(String, Throwable)

Constructs a new runtime exception with the specified detail message and cause.

[Android.Runtime.Register(".ctor", "(Ljava/lang/String;Ljava/lang/Throwable;)V", "")] public RuntimeException (string? message, Java.Lang.Throwable? cause); [<Android.Runtime.Register(".ctor", "(Ljava/lang/String;Ljava/lang/Throwable;)V", "")>] new Java.Lang.RuntimeException : string * Java.Lang.Throwable -> Java.Lang.RuntimeException

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.)

Attributes

RegisterAttribute

Remarks

Java documentation for java.lang.RuntimeException.RuntimeException(java.lang.String, java.lang.Throwable).

Portions of this page are modifications based on work created andshared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

RuntimeException(String, Throwable, Boolean, Boolean)

Caution

This member does not exist on Android. It was erroneously bound.

[System.Obsolete("This member does not exist on Android. It was erroneously bound.", true)] protected RuntimeException (string p0, Java.Lang.Throwable p1, bool p2, bool p3); [<System.Obsolete("This member does not exist on Android. It was erroneously bound.", true)>] new Java.Lang.RuntimeException : string * Java.Lang.Throwable * bool * bool -> Java.Lang.RuntimeException

Parameters

p0 String

p1 Throwable

p2 Boolean

p3 Boolean

Attributes

ObsoleteAttribute

Remarks

Portions of this page are modifications based on work created andshared by the Android Open Source Projectand used according to terms described in theCreative Commons 2.5 Attribution License.

Applies to