且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

IntelliJ IDEA 生成 serialVersionUID

更新时间:2022-06-13 01:15:43

我不确定您是否有旧版本的 IntelliJ IDEA,但如果我转到菜单 FileSettings...检查序列化问题 → 未启用serialVersionUID"的可序列化类,您提供的类给我警告.

I am not sure if you have an old version of IntelliJ IDEA, but if I go to menu FileSettings...InspectionsSerialization issues → Serializable class without 'serialVersionUID'` enabled, the class you provide give me warnings.

如果我尝试第一堂课,我会看到:

If I try the first class I see:

顺便说一句:直到我将 { } 添加到每个类的末尾以修复编译错误后,它才向我显示警告.

BTW: It didn't show me a warning until I added { } to the end of each class to fix the compile error.