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 constructor in Servlet class?

Answer Posted / srikanth b

Yes, we can define constructor in Servlet class.
Constructor may be a Default Constructor or Parameterised
Constructor.
If we didn't write any constructor then the default
constructor will be executed. Because, to read init
parameters of a servlet we need servlet config object in the
life cycle of the servlet. Servlet config object object is
created after the execution of the constructor.

Is This Answer Correct ?    1 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to notify an object in session when session is invalidated or timed-out?

1078


What is http servlet? Explain with the help of an example.

1062


How can you push data from an Applet to a Servlet?

1089


What is the functionality of actionservlet and requestprocessor?

1083


Explain the working of service() method of a servlet.

953


How a servlet is unloaded?

1085


What is the main purpose of java servlets?

1048


Difference between GET and POST?

1148


Explain the lifecycle of a servlet?

964


What is the default http method in the servlet?

1289


How to get the actual path of servlet in server?

1213


What is Servlets and explain the advantages of Servlet life cycle?

1099


Is tomcat a servlet container?

1037


When Servlet is unloaded?

1096


What is httpservlet class?

1137