Explain what is Transient variable in java?

Sharad Jaiswal
Sharad Jaiswal

Posted On: Jan 02, 2020

 

The Transient variable is a modifier that is used in the process of serialization. If the developer doesn’t want to store the value of a particular variable in a file at the time of serialization then they use the Transient keyword. JVM ignores the original value of the variable and saves the default value of that variable data type when it comes across the Transient keyword. It also plays an important role to meet security constraints.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Java Interview Questions asked in Citibank

    Explain Multi-Threading in Java?

    It is a process in java through which multiple threads can be executed simultaneously. A thread can be explained as a lightweight sub-process, it is the smallest unit of processing. Both multiprocessi...