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 write a constructor for a Servlet class ? if yes how ?
if no why not ?

Answer Posted / chandra

constructor required, but it should be public no-argument
constructor. even though if you are not write that
constructor java compiler will create that construtctor by
default. for that your servlet class should be public other
wise you will get RuntimeWxception saying RequestedResource
is not available like that.

Is This Answer Correct ?    9 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why session tracking is needed?

1085


What is the type of method for sending request from http server?

1177


When servlet is loaded?

1122


How can the referrer and the target urls be used in servlet?

1059


How can we refresh automatically when new data is entered into the database?

1149


What do you mean by web applications?

1274


What do you mean by deployment descriptor?

1127


Should I override the service() method?

1138


What is ServletConfig object?

1248


What are the functions of Servlet container?

1171


How do you find out what client machine is making a request to your servlet

1105


Explain the features are in servlet 3?

1103


What is the major difference between servlet and applet?

1060


Is it good idea to create servlet constructor?

1298


What exactly are the functions of servlet?

1161