为什么我们在扩展 RuntimeException 时需要 serialVersionUID?RuntimeException 是一个可序列化的类吗?
public class DataNotFoundException extends RuntimeException {
/**
*
*/
private static final long serialVersionUID = 1;
public DataNotFoundException(String str)
{
super(str);
}
}
Run Code Online (Sandbox Code Playgroud)