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...

Hi guys.. Well can u tell me that why there is need of
"init()" , i mean why can not we initialize the servlet object
with the help of constructors?
Thank you.

Answer Posted / archana

When u create a servlet with a constructor it wont be a
complete servlet but will be in a akward state where it
cannot access Servlet Context and Config.It has to go
through the init() method (though we dont know what code is
written there) to be a complete servlet

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many objects of a servlet is created?

1316


How to read request headers from servlets?

1095


Which is the methods of generated servlet?

1295


What is a servlet context object?

1191


How can you run a servlet program?

1137


Can we override servlet service method?

1150


What is a server side include (ssi)

1236


How do you design microservices?

1153


Explain the difference between jsp and servlet?

1146


Why filter is used in servlet?

1038


What are the benefits of using servlet over cgi?

1128


What is a deployment descriptor?

1156


What is the difference between jsp and servlet life cycle?

1284


What is the web server used for running the Servlets?

1062


Why do we have servlet wrapper classes?

1115