What is transient variable?

By: Karthik Printer Friendly Format    

Answer: Transient variable can't be serialize. For example if a variable is declared as transient in a Serializable class and the class is written to an ObjectStream, the value of the variable can't be written to the stream instead when the class is retrieved from the ObjectStream the value of the variable becomes null.



Most Viewed Articles (in Interview )

What is similarities/difference between an Abstract class and Interface?

What is difference between Java Bean and Enterprise Java Bean?

What is Collection API?

Interview Question: What is Action Class?

Interview Question: What is Struts Validator Framework?

Interview Question: What is ActionForm?

Interview Question: How does Struts work?

Interview Question: Is Struts compatible with other Java technologies?

Interview Question: Do you have to credit Struts on your own website?

Interview Question: How do I install Struts?

Interview Question: Does Struts include its own unit tests?

Interview Question: If the framework doesn't do what I want, can I request that a feature be added?

Interview Question: What about JSTL and JavaServer Faces ?

Interview Question: What is EJB client JAR file?

Interview Question: Can I invoke Runtime.gc() in an EJB?

Latest Articles (in Interview)

Comment on this tutorial