A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Web Component Certification (SCWCD/OCPJWCD)
why most classes and interface in servlet package abstract ?
Joined: Feb 18, 2005
Mar 30, 2005 00:08:00
Please can any one tell me why most classes and interface in
Joined: Nov 28, 2004
Mar 30, 2005 07:38:00
It is obvious that interfaces must be abstract.
Apart from that, only GenericServlet and HttpServlet classes are abstract (if I am not wrong), so they must be subclassed to create an (HTTP)servlet.
For example, to write a generic servlet, you need only override the abstract service method, because the rest of the methods are already implemented in the GenericServlet class.
Joined: Mar 09, 2005
Mar 30, 2005 09:03:00
Interfaces are "rules" so they must be present in specifications implemented by third parties as is the case with
Abstract classes let you create your own classes "extending" the abstract functionality. Moreover, they ease the developer by providing dummy method implementations.
BS<br />SCJP 1.4 88%<br />SCWCD 1.4 86%
I agree. Here's the link:
subject: why most classes and interface in servlet package abstract ?
Difference between interface and abstract class
Interview with 3 Java Gurus Project Leaders! Help needed!
why java.sql package contain most interface like Statement,preparedStatement ?
Interface and Abstract class ........
Difference between abstract classes and interfaces
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014