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

What are advantages of servlets over cgi?

1161


What is http servlet?

1104


What is life cycle of Servlet?

1126


List out the difference between ServletConfig and ServletContext?

1103


What is servlet in tomcat?

1102


Which is the methods of generated servlet?

1298


Define the lifecycle for executing a jsp page.

1140


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

1026


How do you configure a centralized error handler in servlets?

1153


What are the different methods involved in the process of session management in servlets?

1346


What are the life cycle methods of a servlet?

1097


What are the types of protocols supported by httpservlet ?

1279


why we should override only no-agrs init() method.

1189


How do I know if java is running on linux?

1179


What is servlet used for?

1195