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
Brief description about local interfaces?
What class is the top of the awt event hierarchy?
What is the RMI and Socket?
What is the relationship between local interfaces and container-managed relationships?
Which are the different segments of memory?
how do you Handle Front End Application data against DB with example?
what is handle?
whats is mean by tiles in struts
What is TL and its use?
What are the different algorithms used for clustering?
AS a developer will u create a data source in connection pool? If so how will u do that, how to access the object from connection pool using IRAD tool?
Why use a datasource when you can directly specify a connection details?
What is synchronization and why is it important?
whats is statement and procedure
Is the session factory thread safe?