#Java_Interview_Question
129) What is transient keyword?
If you define any data member as transient,it will not be serialized.
👉more details
▪️Java Transient Keyword
Java transient keyword is used in serialization. If you define any data member as transient, it will not be serialized.
Let's take an example, I have declared a class as Student, it has three data members id, name and age. If you serialize the object, all the values will be serialized but I don't want to serialize one value, e.g. age then we can declare the age data member as transient.
@javaCode☕️
129) What is transient keyword?
If you define any data member as transient,it will not be serialized.
👉more details
▪️Java Transient Keyword
Java transient keyword is used in serialization. If you define any data member as transient, it will not be serialized.
Let's take an example, I have declared a class as Student, it has three data members id, name and age. If you serialize the object, all the values will be serialized but I don't want to serialize one value, e.g. age then we can declare the age data member as transient.
@javaCode☕️