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

What are the life-cycle methods for a servlet?

1047


How native code can be used in a servlet?

4115


How to get the current httpsession object?

1169


Difference between java beans & servlets?

1104


What is servlet in tomcat?

1099


Explain servlet events?

1062


What is servlet and its life cycle?

1163


What are the differences between the servletconfig interface and the servletcontext interface?

1252


Which interface should be implemented by all servlets?

1267


What is url encoding and url decoding

1223


What are the differences between servlet context vs servlet config?

1138


Why do you use session tracking in httpservlet?

1190


Name the different ways of session tracking.

1077


What is the capacity the doget can send to the server?

1127


What methodology can be followed to store more number of objects in a remote server?

2318