Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why there are no constructors in servlets?

constructors servlets
0
Posted

Why there are no constructors in servlets?

0

Java:API:Servlets Dharminder Dharna, Feb 28, 2000 A servlet is just like an applet in the respect that it has an init() method that acts as a constrcutor. Since the servlet environment takes care of …

0

A servlet is just like an applet in the respect that it has an init() method that acts as a constrcutor. Since the servlet environment takes care of instantiating the servlet, an explicit constructor is not needed. Any initialization code you need to run should be placed in the init() method since it gets called when the servlet is first loaded by the servlet container.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.