Can we define constructors in Servlet?
Answer Posted / qim2010
One can definitely have constructor in servlet. Even you can
use the constructor in servlet for initialization purpose,
but this type of approach is not so common. You can perform
common operations with the constructor as you normally do.
The only thing is that you cannot call that constructor
explicitly by the new keyword as we normally do. In the case
of servlet, servlet container is responsible for
instantiating the servlet, so the constructor is also called
by servlet container only.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Why are component architectures useful?
Where can I find seam examples and documentation?
What modifiers may be used with an interface declaration?
how to use debug in my elipse to solve problems that exist in my project
What are the difference between RMI and CORBA?
the same information whether it will connect to the database or it will be used previous information?
Is there a guarantee of uniqueness for entity beans?
How would you create a button with rounded edges?
whats is mean by tiles in struts
Do we need to override service() method
What is the highest-level event class of the event-delegation model?
Java is fully object oriented languages or not?
Where we can write Rmi registry in the code, without having to write it at the command prompt?
How many times may an objects finalize() method be invoked by the garbage collector?
what are RemoteObjects?