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 / manas banerjee

you can use but should not.the original reason for init()
was that ancient version of java could not dynamically
invoke constructors with arguments.so there was no way to
give the constructors a ServletConfig.So u would not have
to access to ServletConfig or ServletContext.

{{in short:init() has access to servletconfig and
servletcontext object constructor would not..

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can we achieve transport layer security for our web application?

1038


What is servlet looping or chaining?

1133


What are the common methods that are included in the http servlet class?

1039


How the typical servlet code look like ?

1235


How do we translate jsp?

1054


Which application server is best for java?

1071


What do you mean by servlet?

1147


What exactly is a servlet?

1009


What are all the protocols supported by httpservlet?

1281


Explain get and post.

1109


How can the session in servlet be destroyed?

1159


Explain the different ways for servlet authentication?

1098


What do you mean by the servlet chaining?

1079


What is the use of attribute in servlets?

1046


What do you mean by httpservlet and how it is different from the genericservlet?

1055