Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

why do we need init() , when we have constructor?

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi Guys, I am started studying servlets first time, I have been asked one simple question,

why do we need init() method, when we have servlet constructor to perform initialization things?

My Ans: because we may need to pass objects to initialize,and init() can be overloaded where as servlet constructor can not.
Am I correct? please confirm and provide me some more information if you have.

Cheers...
Shiva
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please check the Servlets FAQ before posting to see if your question has already been addressed, as this one has.
[ October 16, 2008: Message edited by: Bear Bibeault ]
 
    Bookmark Topic Watch Topic
  • New Topic