can servlet have instance variables?

Answer Posted / debapriya maity

Yeah we surely can provide instance variable,but ur servlet
implements MultithreadModel,its is not the right
approach,better use local varibles ,using SingleThreadModel
approach cause perfomance degradation

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Once the destroy() method is called by the container, will the servlet be immediately destroyed? What happens to the tasks(threads) that the servlet might be executing at that time?

766


What is Servlet API used for connecting database?

610


What are different methods of session management in servlets?

770


What is session?

633


What is SingleThreadModel interface?

665






Explain the difference between a web server and a web container?

504


What do you mean by default initialization in java servlet?

596


What is java servlet?

604


What is servlet api used for conneting database?

692


What is the difference between servlet and jsp?

592


What is the purpose of inter-servlet communication?

585


What’s the difference between forward() and sendredirect() methods?

569


Explain web application directory arrangement?

583


What do you mean by servlet?

711


Which application server is best for java?

550