Transient and volatile
By julie111
@julie111 (44)
1 response
@praddyB (4)
• India
22 Sep 07
transient is like an opposite of serializable. it means that when the object is serialized the members which have been marked as transient won't be saved. volatile has to do with system optimization...the runtime caches values of some variables. this can lead to inconsistent read-writes in mutli-threaded applications. in order to avoid this we dclare a variable to be volatile which infrms the java runtim that it must not cache the vaiable.