aspose file tools*
The moose likes Servlets and the fly likes Why should be public? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Why should be public?" Watch "Why should be public?" New topic
Author

Why should be public?

Ganesan Ramakrishnan
Ranch Hand

Joined: Mar 18, 2008
Posts: 88
Hi all,

I have the doubt in servlet class declaration, is there any specific reason for declaring servlet class as public??

Regards
Ganesan
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Why shouldn't it be public?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14150
    
  18

The servlet container should be able to access your servlet class. If it wouldn't be public, the servlet container wouldn't be able to create instances of the servlet.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why should be public?