• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

singlethread model

 
geeta vemula
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is from enthuware

Question 17 of 60
Consider the following servlet code:

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

Which of the following statements are correct?



Select 1 correct option.
a The servlet container can run multiple threads simultaneously on the same instance of this servlet.
b The servlet container CANNOT run multiple threads simultaneously on the same instance of this servlet.
c It'll not compile because a servlet cannot implement Runnable.
d It'll compile but will throw exception at request time.
e None of these.

here answer is e.

if a,b,c,d are wrong then what happens exactly, i mean it should have given compiler error or runtime error, if not both then it could have excetuted in either of the two ways(single threded or multithreded)
but it is also wrong

geeta


 
Paul Anilprem
Enthuware Software Support
Ranch Hand
Posts: 3820
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Geeta,
Can you please post the question id for this question (the simulator shows it on the top while viewing the question) so that I can investigate?
The closest that I could find is question id com.enthuware.ets.scwcd.v5.2.526 and it has no reference to SingleThreadModel. Please see the attached image.

q526.jpg
[Thumbnail for q526.jpg]
Question Details
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic