transient - cheyiliu/All-in-One GitHub Wiki

transient

  • In the Java programming language, transient is a keyword used as a field modifier. When a field is declared transient, it would not be serialized even if the class to which it belongs is serialized. In Java, methods, classes and interfaces cannot be declared as transient, because they are never serialized.

demo

ref