• 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:

Modifier

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

Please help me with this question from a mock exam.

Which modifier or modifiers should be used to denote a variable that should not be written out as part of its class' persistent state? (Choose the shortest possible answer.)

Options are:

1-private
2-protected
3-private protected
4-transient
5-private transient

As per me the answer should be private, but its transient.

I found diffrent diffrent answer for this question in diffrent mock test.
so confused.

Please help me with this.

Thanks
Sandhya
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
They refer to two very different concepts:

1. the class persistent state refers to the action of save the object (and its members) to a database. Which members should be saved (should be persisted) and which ones not (should not be persisted because they are in effect "transient").

2. the degree of access/visibility the class allows to the rest of the universe (other packages and or classes).
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The question tests Exam objective 3.3 on Serialization. The answer is transient.
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guys,
What about 5. private transient..
it also seems to be a possible correct answer.
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Rahul Singhai:
Guys,
What about 5. private transient..
it also seems to be a possible correct answer.



(Choose the shortest possible answer.)

 
reply
    Bookmark Topic Watch Topic
  • New Topic