aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes HFJS - final mock - q55 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "HFJS - final mock - q55" Watch "HFJS - final mock - q55" New topic
Author

HFJS - final mock - q55

Steven Colley
Ranch Hand

Joined: Feb 18, 2005
Posts: 290
Please, could anyone explain this question to me?

what the answer is "BBUBUB" ?

Tks.


SCJP | SCWCD | SCBCD | SCWSD 5 | SCEA (I) 1.4 | SCEA 5 | IBM SOA 669
senthil rajan
Ranch Hand

Joined: Aug 31, 2005
Posts: 36
Hi Frnds,
Its a unsolvable problem for me too...

Can anybody give some idea about this???

Thanks,
Senthil.
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

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


Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Jigar Gosar
Ranch Hand

Joined: Jul 09, 2002
Posts: 95
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 ]

Regards,<br />Jigar Gosar (SCJP 1.4)<br />visit: <a href="http://jigar.org/blog" target="_blank" rel="nofollow">http://jigar.org/blog</a>
Akshay Kiran
Ranch Hand

Joined: Aug 18, 2005
Posts: 220




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


"It's not enough that we do our best; sometimes we have to do<br />what's required."<br /> <br />-- Sir Winston Churchill
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: HFJS - final mock - q55