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 are the important functions of filters?

599


Servlet is pure java object or not?

719


What is the servlet?

623


What's the difference between authentication and authorization?

552


What do you mean by a filter and how does it work?

540






What’s the difference between sendredirect and forward methods

565


Why do we need a constructor in a servlet if we use the init method?

519


What is cookie? Why is cookie used?

582


What is servlet in simple terms?

570


Can we use the constructor, instead of init(), to initialize servlet?

584


Explain the servlet context.

602


How can we implement a jsp page?

631


What is meant by servlet? What are the parameters of the service method?

578


What is getservletcontext?

552


What are session variable in servlets?

568