Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

just to share

 
Poonam Agarwal
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello ranchers,

Just to share this question with all of you.(Enthuware Mock).

Consider the following servlet code:

import javax.servlet.*;
public MyServlet extends GenericServlet implements Runnable
{
public void run()
{
//do something.
}
}

Which of the following statements are correct?
1. The servlet container can run multiple threads simultaneously on the same instance of this servlet.
2. The servlet container CANNOT run multiple threads simultaneously on the same instance of this servlet.
3. It will not compile because a servlet cannot implement Runnable.
4. It will compile but will throw exception at request time.
5. None of these.

Anybody knows the right answer. ??
its 1, 5 are the correct one. I don't undestand the purpose of this question?? normaly we choose "none of these" where rest of the options dosen't fit.
here we have to "none of these" with other option right.

 
Ankit Garg
Sheriff
Posts: 9597
36
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well since option 1 is a valid option, so option 5 cannot be the correct answer...
 
Paul Anilprem
Enthuware Software Support
Ranch Hand
Posts: 3880
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This question has already been fixed. Kindly download the latest version from http://enthuware.com/alletsbanks.html ( direct link http://www.enthuware.com/downloads/jwpv5.ets )
 
Poonam Agarwal
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, thanks Paul
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!