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 / vivekanand prasad

The init() method creates and loads the servlet.But the servlet instance is first created through the constructor (done by Servlet container). We cannot write constructors of a servlet class with arguments in servlet (It will throw Exception). So, They provided a init() method that accepts an ServletConfig object as an argument.ServletConfig object supplies a servlet with information about its initialization (init) parameters.Servlet class cannot declare a constructor with ServletConfig object as a argument and cannot access ServletConfig object.

Is This Answer Correct ?    20 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How are commas used in the intialization and iteration parts of a for statement?

1093


Define the remote object implementation?

2502


For which statements does it make sense to use a label?

1078


Explain about local interfaces.

1053


Which component handles cluster communication in jboss?

1105


How task's priority is used in scheduling?

2295


how to use debug in my elipse to solve problems that exist in my project

2280


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

1037


What is the relation between the infobus and rmi?

1006


Name the eight primitive java types.

1124


Why does the tag url-encode javascript and mailto links?

1004


hi friends, i have done my BE(CSE)at 2011 then i have joined one company before they asked me 50k so i paid but now they telling no project here so we r going to close like that so now i need any job i have good knowledge in core java and j2ee(jsp,servlet,jdbc) so if u know any job pl help me

2219


Why use a datasource when you can directly specify a connection details?

1028


Difference between swing and awt?

1290


what is a non-repeatable read?

2417