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
why we should override only no-agrs init() method.
Why doesn’t a servlet include main()? How does it work?
How to get the current httpsession object?
Is servlet a framework?
What do you mean by request dispatcher in servlet? Also explain its methods.
What are the different session tracking techniques?
What is a web container and what is its responsibility?
What is the difference between Servlet Request and Servlet Context when calling a Request Dispatcher?
What is the main purpose of java servlets?
Write a program to show the functionality of servlets.
Explain the concept of ssi ?
How can you push data from an Applet to a Servlet?
How can we refresh automatically when new data has entered the database?
Is servlet thread safe?
Which method of the httpservletrequest object is used?