Win a copy of The Java Performance Companion this week in the Performance 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
  • 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
  • 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