• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Doubt in servlet API

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I was browsing the Servlet API and i came across the Servlet interface.
There are many functions under the Servlet interface.Some of which are as follows


java.lang.String getServletInfo()
void init(ServletConfig config)
void service(ServletRequest req, ServletResponse res)
Each of these functions have different purposes,Some even return values.

An interface has no method implementations in it.
My Question is:
How can an Interface like Servlet have methods that return value without any implementations in them?Please do reply. Thank you in advane
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you aware what an interface in java is ?
 
nidhivel raja
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes
Interface has is a group of method definitions .
 
nidhivel raja
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by nidhivel raja:
Yes
Interface has is a group of method definitions .



Sorry for the mistake
Interface is a group of method definitions
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Servlet is very generic and abstract. Servlet as a concept is not protocol specific. If you see some implementation for example implementation for HHTP protocol it comes with some implementaion as how to handle that. You can write some implementation that can handle FTP etc that will have the implementation.



The rest will be given by the user who is extending them(..business).
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As with all other interfaces, a concrete class implements that interface. In the case of Servlet, the container defines and instantiates the concrete class.
 
nidhivel raja
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Mr.Sangram Mhatre, Mr.Vijay Jeyam and Mr.Bear Bibeault my doubt is cleared now
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic