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

What is load-on-startup in servlet?

794


How the servlet is loaded?

782


How do you find out what client machine is making a request to your servlet

748


What is the use of request dispatcher interface?

764


What are the different ways we can maintain state between requests?

768


What is the need of servlet filters?

733


What are the functions of an intercepting filter?

707


What are some disadvantages of storing session state in cookies?

783


Explain servlet life cycle?

823


What is httpservlet and how it is different from genericservlet?

803


Differentiate between the get and post method

781


Is dispatcher servlet a singleton?

731


What’s the use of the servlet wrapper classes??

833


What are the functions of the servlet container?

1303


How are filters?

799