What is the effect of static final transient in Java?
A static
field is implicitly transient
(when serializing a static
field, its value will be lost anyway). So indeed, no need to declare both.
The transient
keyword on a variable will ensure that the variable is not part of the serialized object when serializing. If your class is not serializable
, nor a JPA entity (which uses the transient keyword to avoid storing variables in the database), removing it should be fine.