• Post Reply Bookmark Topic Watch Topic
  • New Topic

Why this statement is correct?

 
Amandeep Singh
Ranch Hand
Posts: 850
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the service(ServletRequest, ServletResponse) method is overridden, it cannot be made protected.

Well the reason given in Enthuware is
Because it is declared in an interface [javax.servlet.Servlet] and all interface methods are public. You cannot reduce the accessibility of an overriding or implementing method.
 
Ramesh Ponnada
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See this thread :

Overridden Methods
 
Amandeep Singh
Ranch Hand
Posts: 850
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ramesh, you are great...
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!