Win a copy of Event Streams in Action this week in the Java in General forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

SCWCD Mock Questions

Ranch Hand
Posts: 634
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I find the answers of the following 2 mock questions ambiguous.

Assuming that the Servlet Container has just called the destroy() method of a servlet instance, which of the following statements are correct?
Select 2 correct options.

A.Any resources that this servlet might hold have been released.
B.The servlet container time out has exceeded for this servlet instance.
C.The init() method has been called on this instance.
D.None of the requests can EVER be serviced by this instance.
E.All threads created by this servlet are done.

correct answer:C,D

I think answers should be:A,E

For a tag to accept any valid jsp code as its body, what should be the value of <body-content> for this tag's taglib descriptor?
Select 1 correct option.

E.The <body-content> subelement itself may be absent.

correct answer:JSP
I think answer should A and E both
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey there,

Q1 You may have used a recordset for example and forgot to do a close() on it therefore A cannot be right. Also I may created a thread in my servlet and left it hanging with some work or even just sleeping without it being trashed.

While you can be sure that if the destroy() just executed then the servlet must have gonne throught its lifecycles being init() one of them.

The answer D leaves me puzzled since there is only once servlet instance by the jvm I thought the container would reuse the servlet instances...

Q2 Only one can be right and by default (i.e.: missing the body-content element) is scriptless.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!