Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
    Bookmark Topic Watch Topic
  • New Topic

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

 
shivaprasad patla
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • 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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64851
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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