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
Describe responsibilities of Activator?
What are the benefits of detached objects?
Can constructors be synchronized in java?
What is a tasks priority and how is it used in scheduling?
why static class in java
What is the relation between the infobus and rmi?
How to implement dphibernate to activate lazy loading in Flex with java ?thanx in advance!
Do I have to use jsps with my application?
Name the class that is used to bind the server object with RMI Registry?
Is infobus easy to use?
Why is string immutable in java?
How would you detect a keypress in a jcombobox?
What is the difference between RMI registry and OS Agent?
What is a session? Can you share a session object between different theads?
What method is invoked to cause an object to begin executing as a separate thread?