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

What is the purpose of the notify() method?

1024


Explain what is synchronization?

1051


Explain about thread synchronization inside a monitor?

2491


Do I need to import javlang package any time? Why ?

1049


Is a class a subclass of itself?

1142


How to pass parameters in RMI?

2224


What is the difference between RMI and Corba?

2687


What is the difference between the ‘font’ and ‘fontmetrics’ class?

1114


Explain phantom read?

2178


Have you used threads in Servelet?

2476


Is the session factory thread safe?

1131


How substring() method of string class create memory leaks?

1001


What is the difference between static and non-static with examples?

1870


What is the purpose of the finally clause of a try-catch-finally statement?

989


whats is mean by tiles in struts

2151