This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Servlets and the fly likes constructors in servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "constructors in servlets" Watch "constructors in servlets" New topic
Author

constructors in servlets

sandy sean
Ranch Hand

Joined: Dec 30, 2010
Posts: 69
Hi!

Why there are no constructors in servlets?

thanks...
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61106
    
  66

There are. Servlets are just like any other Java class. Constructors just aren't particularly useful in servlets as the init() life-cycle method is used to initialize a servlet.

This has been covered many times before. Please SearchFirst.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: constructors in servlets