Java- transient modifier / Chapter -9 / Access Modifier


java transient modifier

Java transient modifier


1. transient is the modifier applicable only for the variable.

2. We can use the transient keyword in serialization context.

3. At the time of serialization if we don't want to save the value of a particular variable to meet security constraint then we should declare that variable as transient.

 




4.At the time of serialization, JVM ignores the original value of the transient variable and save default value to the file.

5.Hence "transient means not to serialize".

No comments:

Post a Comment

Be the first to comment!

Don't just read and walk away, Your Feedback Is Always Appreciated. I will try to reply to your queries as soon as time allows.

Note:
1. If your question is unrelated to this article, please use our Facebook Page.
2. Please always make use of your name in the comment box instead of anonymous so that i can respond to you through your name and don't make use of Names such as "Admin" or "ADMIN" if you want your Comment to be published.

Regards,
JavaByChetan
Back To Home

Flipkart End Of Season Sale






© Copyright 2017 Javabychetan.blogspot.com