• Post Reply Bookmark Topic Watch Topic
  • New Topic

calling methods on interface references.  RSS feed

 
krishna prasad gunasekaran
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We know that HttpServletRequest,HttpServletResponse are interfaces. But we call methods using these references. Do request and response objects created by the container implement these interfaces, and we call methods on these objects using references of their respective interface.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you've got the picture
 
Ravinder Rana
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, the container gives us an implementation of these interfaces. Just think for a moment, if they doesn't implement these interfaces how can we call the methods using these interfaces?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could even try to log request.getClass() to check what its class is.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!