Most visited

Recently visited

Added in API level 1

InvalidClassException

public class InvalidClassException
extends ObjectStreamException

java.lang.Object
    java.lang.Throwable
      java.lang.Exception
        java.io.IOException
          java.io.ObjectStreamException
            java.io.InvalidClassException


序列化运行时检测到某个类遇到以下问题之一时引发。

摘要(Summary)

Fields

public String classname

无效班级的名称。

Public constructors

InvalidClassException(String reason)

根据指定的原因报告InvalidClassException。

InvalidClassException(String cname, String reason)

构造一个InvalidClassException对象。

公共方法(Public methods)

String getMessage()

产生消息并包含类名(如果存在)。

继承方法(Inherited methods)

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

Fields

classname

Added in API level 1
String classname

无效班级的名称。

Public constructors

InvalidClassException

Added in API level 1
InvalidClassException (String reason)

根据指定的原因报告InvalidClassException。

参数(Parameters)
reason String: String describing the reason for the exception.

InvalidClassException

Added in API level 1
InvalidClassException (String cname, 
                String reason)

构造一个InvalidClassException对象。

参数(Parameters)
cname String: a String naming the invalid class.
reason String: a String describing the reason for the exception.

公共方法(Public methods)

getMessage

Added in API level 1
String getMessage ()

产生消息并包含类名(如果存在)。

返回(Returns)
String the detail message string of this Throwable instance (which may be null).

Hooray!