| Author |
Doubt in servlet API
|
nidhivel raja
Ranch Hand
Joined: Jun 26, 2008
Posts: 36
|
|
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
|
 |
sangram mhatre
Greenhorn
Joined: Apr 02, 2005
Posts: 15
|
|
|
Are you aware what an interface in java is ?
|
 |
nidhivel raja
Ranch Hand
Joined: Jun 26, 2008
Posts: 36
|
|
Yes Interface has is a group of method definitions .
|
 |
nidhivel raja
Ranch Hand
Joined: Jun 26, 2008
Posts: 36
|
|
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
|
 |
Vijay Jeyam
Greenhorn
Joined: Nov 12, 2008
Posts: 15
|
|
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).
|
Never Never Never Give Up...!!!
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56191
|
|
|
As with all other interfaces, a concrete class implements that interface. In the case of Servlet, the container defines and instantiates the concrete class.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
nidhivel raja
Ranch Hand
Joined: Jun 26, 2008
Posts: 36
|
|
Thank you Mr.Sangram Mhatre, Mr.Vijay Jeyam and Mr.Bear Bibeault my doubt is cleared now
|
 |
 |
|
|
subject: Doubt in servlet API
|
|
|