aspose file tools*
The moose likes Servlets and the fly likes instance of servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "instance of servlet" Watch "instance of servlet" New topic
Author

instance of servlet

Arun Maalik
Ranch Hand

Joined: Oct 25, 2005
Posts: 216
Dear sir

I know that instance of servlet is created when init() method is called but in book of head first it has been written that init() method is called after creation of instance please specify these things.

Actualy what is the instance of a servlet ?

Thanks

Arun kumar maalik
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60998
    
  65

A method cannot be called on an instance of an object until after it has been created. So init() can't create the servlet instance, it is called by the container after the instance has been created.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Servlets are no different.They are also like other java classes.
So you need to create instance before calling method init().


Rahul Bhattacharjee
LinkedIn - Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: instance of servlet