• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

singlethread model

 
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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


 
Enthuware Software Support
Posts: 4544
45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
I child proofed my house but they still get in. Distract them with this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic