transient
is used to mark fields in a Serializable
class which will not be written out to file (or stream). In a class
that does not implement Serializable
, this modifier is simply wasted keystrokes, and should be removed.
class Vegetable { // does not implement Serializable private transient Season ripe; // Noncompliant // ... }
class Vegetable { private Season ripe; // ... }