| Author |
Java
|
Shantanu Puranik
Ranch Hand
Joined: Jun 10, 2004
Posts: 66
|
|
|
In Which situation we should choose Abstract and in which situation we should use Interface
|
--- Shantanu
|
 |
Shraddha Jain
Greenhorn
Joined: Feb 02, 2006
Posts: 27
|
|
if there's something u want every subclass to do exactly the same way and there are things u cannot generalize u can go for an abstract class take IceCream for instance it could be of many flavors - vanilla,choclate, coffee, butterscotch......... so they all will taste() differently depending on their flavor, but when u say melt() they simply have to ...well melt!! so in this case u could use an Abstract class Icecream: abstract class IceCream{ public void melt() { }.....melt!!! abstract Taste taste(); }
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
shantanu, This forum is for Servlet related questions. Moving to Java In General (Beginner).
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
 |
|
|
subject: Java
|
|
|