Can we write a constructor for a Servlet class ? if yes how ?
if no why not ?
Answer Posted / narayana rao dasari
yes.....! we can write constructor for servlet class why
because every java class allows construction initialization
if we do not write constructor explicitly it will call
default constructior.
If we call our own constructiors means we will not able to
access the servelet config objects so better wat is to
intializeing in init() method......thank u,
Narayan
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is Servlet API used for connecting database?
What is difference between the HTTP Servlet and Generic Servlet? Explain about their methods and parameters?
What is ServletConfig object?
What are the types of servlet?
What do you mean by chaining in servlet?
What are some disadvantages of storing session state in cookies?
Explain web application directory arrangement?
How can we implement a jsp page?
Explain the role of dispatcherservlet and contextloaderlistener.
What is the life cycle of a servlet?
What do you mean by the servlet chaining?
Which application server is best for java?
What are the new features added to servlet 2.5?
What’s the difference between sendredirect and forward methods
What are the supporting protocol by HttpServlet ?