3
Reply

What is the need of transient variables in Java ?

Marcus

Marcus

13y
32.9k
0
Reply

    Variables may be marked transient to indicate that they are not part of the persistent state of an object.
    __________________________________________

    MBA consultants in India

    If you mark an instance field of a Java class as 'transient', it means that it is not part of the persistent state of  an object of that class.

    Its main use is when you're serializing an object. Any fields marked as 'transient' are simply ignored in the serialization process. This is equivalent in C# to marking a field with the NonSerialized attribute.

    which type send me [email protected]


    when u achived