• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

transient

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
why, how & where to use the word transient? please explain with an example. u can mail the results at [email protected]
 
author
Posts: 621
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The transient modifier is used to optimise serializable objects. Say you have a class that has lot of class scope variables. Now you want to write the class to disk (to save a users preferences or something). Perhaps one the class level variables is a big array that you don't want/need to save. Simply declare this variable as 'transient' and when the class is serialized, the transient variable will be ignored. Hope this clears things up.
Sean
 
reply
    Bookmark Topic Watch Topic
  • New Topic