wood burning stoves 2.0*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Doubt in Mock Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Doubt in Mock Question" Watch "Doubt in Mock Question" New topic
Author

Doubt in Mock Question

raja ram
Ranch Hand

Joined: Mar 02, 2008
Posts: 169
Hi,

I have taken this questions from Marcus

1.A session attribute can store either a class or primitive type ?

My answer for this is TRUE, because in the below code i am getting

out put as 10. but the answer given is FASLE

2.which of the following will set the Content type to Image/GIF


My answer is both but answer given is setContentType() why is it so?

Thanks
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Originally posted by raja ram:

1.A session attribute can store either a class or primitive type ?


Actually,you can store any kind of object in session not premitive.

if you use jdk 1.5 or higher version then it automatically unbox the premitive to object


2.which of the following will set the Content type to Image/GIF


My answer is both but answer given is setContentType() why is it so?



Hmmm.... i think you are right
raja ram
Ranch Hand

Joined: Mar 02, 2008
Posts: 169
Hi,
As this is SCWCD 1.5 exam,the answer to the first Question will be True.We can store primatives in session, is that correct?

Thanks
Michael Ku
Ranch Hand

Joined: Apr 20, 2002
Posts: 510
What happened when you tried to execute the code yurself?
Swathi Sri
Greenhorn

Joined: Jan 18, 2007
Posts: 22
According to the explanation, the answer to first question should be True.
Michael Ku
Ranch Hand

Joined: Apr 20, 2002
Posts: 510
What happened when you tried to execute the code yourself?


the blackboard vs the keyboard :-)
 
wood burning stoves
 
subject: Doubt in Mock Question
 
Similar Threads
Rollover effects within HTML
SAAJ (SOAP 1.1) incompatibility with Java 1.6
Request parameter is missing
Showing image from servlet
file upload problem using internet explorer 8