File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Servlets
Bookmark "constructors in servlets" Watch "constructors in servlets" New topic

constructors in servlets

sandy sean
Ranch Hand

Joined: Dec 30, 2010
Posts: 69

Why there are no constructors in servlets?

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63852

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] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: constructors in servlets
It's not a secret anymore!