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
What is synchronization and why is it important?
How are the elements of a cardlayout organized?
What is the relationship between the canvas class and the graphics class?
What are the different class loaders used by jvm?
What is the difference between the session.update() method and the session.lock() method?
What is a class loader? What are the different class loaders used by jvm?
what is Activation Instantinator?
What is a sessionfactory? Is it a thread-safe object?
how to make a index.jsp for running the site in internet and find an error for connection with weblogic server and java that give an error invalid object name.and how to maintain session.
Difference between loadclass and class.forname?
Why doesn’t the focus feature on the tag work in every circumstance?
How would you create a button with rounded edges?
What is the difference between RMI and Corba?
If we opened Windows Internet Explorer 4 times, does it starts 4 processes or 4 threads?
In our urls and in the text of the buttons we have comma. Its causing an error. Is there a way to change the delimiting character for the menu arguments?