Java: Static transient fields

前端 未结 2 1375
抹茶落季
抹茶落季 2021-01-31 14:11

I just found out in Java you can declare a field \'static transient\' - the compiler doesn\'t complain. This doesn\'t seem to be useful in any way since static fields are not se

2条回答
  •  野性不改
    2021-01-31 15:11

    Nope - you said it yourself, static fields aren't serialized.

    Kinda weird that the compiler lets you do that though.

提交回复
热议问题