This week's book giveaway is in the Open Source Projects forum.
We're giving away four copies of Eclipse Collections Categorically: Level up your programming game and have Donald Raab on-line!
See this thread for details.
  • 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
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

HFJS - final mock - q55

 
Ranch Hand
Posts: 290
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please, could anyone explain this question to me?

what the answer is "BBUBUB" ?

Tks.
 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Frnds,
Its a unsolvable problem for me too...

Can anybody give some idea about this???

Thanks,
Senthil.
 
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey dudes
can you tell what exactly that constant means.. is it an answer to a question? or any other technical term?

Good times ahead.
Raghavan alias Saravanan M
 
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if BBUBUB is correct than, it can be infered that, when setAttribute is called for the second time than valueBound(for second attribute) is called before valueUnbound (for first attribute) is called.

I have read the spec but it doesnot specify the order in which valueBound valueUnbound methods are called.

so, can some one tell me the order in which methods valueBound/valueUnbound of Interface HttpSessionBindingListener will be called for the following code.
assume there is a class called X that implements HttpSessionBindingListener. Now,


according to me the order must be
1. valueBound - for first object X()
2. valueUnbound - for first object X()
3. valueBound - for second object X()

but according to the answers of q55 final mock exam HFSJ, the order is

1. valueBound - for first object X()
2. valueBound - for second object X()
3. valueUnbound - for first object X()

can someone tell me the correct order in which these functions are called.

thanks.
[ April 22, 2006: Message edited by: Jigar Gosar ]
 
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator




clearly, the order of execution is
valueBound for the first one
valueBound for the second one (because the value of the first one will be unBound only after it is replaced)
valueUnbound for the first one
(here, the string value is added, but the String class doesn't implement the HttpSessionBindingListener, so valueBound or Unbound won't be called for adding or removing "x")
valueUnbound for the second one (because it has now been replaced by "x")

so clearly, the outpu will be
B B UB UB
 
Grow a forest with seedballs and this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic