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 ioc concept?
Describe activation process?
What is the difference between a static and a non-static inner class?
What’s jboss cache in short?
What is colon_pkg_prefixes and what is its use?
Difference between swing and awt?
When is the best time to validate input?
What is prototype?
What are externizable interface?
What is difference between object state and behavior?
what is Activation Instantinator?
What is the difference between the string and stringbuffer classes?
What is synchronization and why is it important?
Java is fully object oriented languages or not?
Is there a guarantee of uniqueness for entity beans?