• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

transient variable?

 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi frnds

i have got a doubt regarding transient variable while reading Heller and Roberts book...

Which of the following statements is true?
A.Transient methods may not be overridden.
B.Transient methods must be overridden.
C.Transient classes may not be serialized.
D.Transient variables must be static.
E.Transient variables are not serialized.



here the answer given is E.i just wanted to know that why not transient variable be static and also i feel that they can be serializable .

please can anyone clear my doubt

thanks & regards

srikanth
 
Ranch Hand
Posts: 335
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
transient can only be applied to variables,

transient keyword is used its meaning is that they are not to be serialized
read about it.
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the key word in answer D is *must*.

You can, but you don't have to, thus the statement isn't true.

Thinking some more on it, I don't see why a static variable would be serialized anyway. The only thing that you would 'save' during serialization would be the instance variables.

Either way, D is not correct.

[ October 04, 2005: Message edited by: Will Fleming ]
[ October 04, 2005: Message edited by: Will Fleming ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic