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

which is thread save

 
salman ahmed
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Q-1)class ABC extends HttpServlert
{
AnyClass obj;
public void init()
{
Classboject obj=new Classboject();
}
}
Q-2)class ABC extends HttpServlet
{
public void get(HttpServletRequest req,HttpServletRequest res)
{
/*html required tags and session creation*/
synchronized(session)//any seesion created before
{
<form method=post>
inputtype=text name=one
inputtype=text name=two
</form>
}

public void post(HttpServletRequest req,HttpServletRequest res)
{
}
}
Q-1 IS OBJ IS SYNCHRONIZED.T/F
Q-2 IN Q-2 WHEN CALLING POST METHOD IN THE SAME CLASS THEN IT IS IT AUTOMATICALLY THREAD SAVE
T/F
Q-3 IN Q-2 if <form action=gotooherservlet method=post> i.e go to oher page then is that post method will be ThreadSafe
T/F



}
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

When posting qstns, could you please post the source of these
qstns for the benefit of people like me....Thanks.
- satya
 
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!