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

What are local interfaces? Describe.

1235


what are getters and setters in Java with examples?

1781


Will the general public have access to the infobus apis?

1047


Is “abc” a primitive value?

1111


Do I have to use jsps with my application?

1023


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

1009


Define aop(assepct oriented programing)?

1182


What is abstract schema?

1028


What does module-relative mean?

1164


Are there books about seam?

1110


Explain about local interfaces.

1060


How a component can be placed on Windows?

2857


Is infobus easy to use?

1041


Are enterprise beans allowed to use thread.sleep()?

1152


If your ui seems to freeze periodically, what might be a likely reason?

1042