File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why we can't decare doPost() as default access specifier?

 
Soumya Ranjan Mohanty
Ranch Hand
Posts: 44
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why We declare the servlet class as Public and dopost() as public or protected??
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/http/HttpServlet.html

You cant reduce the visibility of doPost in Subclass .it is one of the Override rule.

also public servlet class is visible to other packages also.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic