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...

Can we define constructors in Servlet?

Answer Posted / qim2010

One can definitely have constructor in servlet. Even you can
use the constructor in servlet for initialization purpose,
but this type of approach is not so common. You can perform
common operations with the constructor as you normally do.
The only thing is that you cannot call that constructor
explicitly by the new keyword as we normally do. In the case
of servlet, servlet container is responsible for
instantiating the servlet, so the constructor is also called
by servlet container only.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Describe responsibilities of Activator?

2171


What are the benefits of detached objects?

1013


Can constructors be synchronized in java?

1065


What is a tasks priority and how is it used in scheduling?

1004


why static class in java

1721


What is the relation between the infobus and rmi?

953


How to implement dphibernate to activate lazy loading in Flex with java ?thanx in advance!

2943


Do I have to use jsps with my application?

976


Name the class that is used to bind the server object with RMI Registry?

2112


Is infobus easy to use?

989


Why is string immutable in java?

1057


How would you detect a keypress in a jcombobox?

1088


What is the difference between RMI registry and OS Agent?

1074


What is a session? Can you share a session object between different theads?

936


What method is invoked to cause an object to begin executing as a separate thread?

977