Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Can we write a constructor for a Servlet class ? if yes how ?
if no why not ?

Answer Posted / abhishek taneja

yes offcourse you can write a constructor for a servlet
after all it is a java class. you can simply provide but if
u do not provide then it is by default include the no
argument constructor that is used by the Init() method in
the servlet life cycle.

Is This Answer Correct ?    11 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you find out what client machine is making a request to your servlet

1023


What do you mean by filter in servlet?

957


Which interface should be implemented by all servlets?

1173


What is meant by Servlet? What are the parameters of service method?

1016


How we can call a jsp from the servlet?

962


Are Servlets Thread Safe? How to achieve thread safety in servlets?

926


What's the servlet interface?

1041


What do you mean by session tracking?

1156


Can you explain in detail 'javax.servlet' package?

944


how many jsp scripting elements are there and what are those?

975


What is servlet and its use?

1057


Is java servlet still used?

999


What are session variable in servlets?

985


What’s the difference between genericservlet and httpservlet?

1031


What are the different ways we can maintain state between requests?

1061