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

What is life cycle of Servlet?

787


What is Client-Server Computing?

2079


Why is a constructor needed in a servlet even if we use the init method?

794


How do I use cookies to store session state on the client?

712


How does Cookies work in Servlets?

872


What are the steps involved in placing a servlet within a package?

821


What is the difference between portlet and servlet?

695


Whats the advantages using servlets over using CGI?

779


What is load-on-startup in servlet?

789


Write all the phases defined in servlet life cycle?

753


Explain the jar and war files in servlet?

798


What is meant by session? Tell me something about httpsession class?

774


How printwriter is different from servletoutputstream?

764


What is the procedure for initializing a servlet?

739


What is a java servlet?

753