can v create a constructor 4 servlet?

Answer Posted / paidi

Yes, It can possible to create the constructor inside the
servlet , it wont give any exception or error for creation
and it compile properly. But, Servlet initialization will
done by container. Container calls the init() to
initialize the servletconfg obj. No Use to write the
constructor inside the servlet.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

The code in a finally clause will never fail to execute, right?

692


What do you mean by httpservlet and how it is different from the genericservlet?

630


Differentiate between the get and post method

666


What is cgi?

679


What is dispatcher servlet?

653






What are life cycle methods of a servlet?

666


What is difference between server and servlet?

656


What is servlet and its advantages?

622


What is the difference between 2 types of servlets?

727


Define the lifecycle for executing a jsp page.

679


Whats the advantages using servlets over using CGI?

664


What is servlet looping or chaining?

757


What is the use of httpservletrequestwrapper and httpservletresponsewrapper?

628


Which java application server is the best?

649


Is servlet a controller?

643