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

What is the disadvantage of cookies?

1035


Why is a constructor needed in a servlet even if we use the init method?

1211


How do you get the ip address of the client in servlet?

1061


What is the functionality of actionservlet and requestprocessor?

1141


What is the difference between Servlet Request and Servlet Context when calling a Request Dispatcher?

1332


How will you pass values from HTML page to the servlet?

1100


What's the architecture of a servlet package?

1096


What is the use of welcome-file-list?

1074


When servlet object is created?

1226


What is called servlet mapping?

1152


Describe in brief RequestDespatcher?

1182


Write a program to show the functionality of doget and dopost method?

1257


What is the web server used for running the Servlets?

1062


What are the uses of servlet and what is servlet chaining?

1147


Explain request dispatcher and its methods.

1062