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 are different Authentication options available in Servlets.
What are the exceptions thrown by servlets? Why?
What is Request Dispatcher?
What are the benefits of using servlet over cgi?
why we should override only no-agrs init() method.
What is session?
Is servlet thread safe?
What do you mean by web applications? Explain web application directory arrangement?
What do you mean by servlet context?
Explain how to improve Servlet Performance?
Difference between GET and POST?
What is a server side include (ssi)
What if you need to span your transaction across multiple servlet invocations?
What are the life-cycle methods for a servlet?
When a client request is sent to the servlet container, how does the container choose which servlet to invoke?