This article is originally posted by me in Java Code Geeks with title
The Transient Keyword in Java and Its Use
I recently came a cross in a study project of one of my friends that are studding the basics of programming in Java some forgotten sensitive information printed in text files and remembered the transient keyword in Java.
The transient keyword in Java plays an important role in terms of security and can be very useful in “accidents” like the one above as it will prevent the transmission of sensitive information like for example passwords to files, JSON messages etc that will require serialization.
To cut the long story short, if you define any variable as transient, it will not be serialized unless you define it as static or final.
Lets see some examples bellow. Continue reading “The Transient Keyword in Java and Its Use” →