Author
Differences betweenabstract classes & interfaces
Saral Saxena
Ranch Hand
Joined: Apr 22, 2011
Posts: 202
posted Dec 13, 2011 23:05:52
0
HI fOLKS,
I want to know the practical and technical differences between the abstract classes and interfaces..?
Hebert Coelho
Ranch Hand
Joined: Jul 14, 2010
Posts: 754
posted Dec 13, 2011 23:09:36
0
No need to open two topics almost indenticals.
http://www.coderanch.com/t/561659/java/java/abstract-class-Vs-Interface-real
[uaiHebert.com ] [Full WebApplication JSF EJB JPA JAAS with source code to download ] One Table Per SubClass [Web/JSF ]
Gamini Sirisena
Ranch Hand
Joined: Aug 05, 2008
Posts: 347
posted Dec 13, 2011 23:28:44
0
I think the main difference is that when you want to have common functionality for all child classes
you can use abstract classes (i.e. the abstract class can have method implementations and even constructor implementations)
If an interface is used for such a scenario, all implementing classes will have to implement the common logic.
Saral Saxena
Ranch Hand
Joined: Apr 22, 2011
Posts: 202
posted Dec 14, 2011 01:55:30
0
abstract class can have method implementations and even constructor implementations
Hi,
Please explain about the constructor implementations in context to abstract classes..!!1
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
posted Dec 14, 2011 02:19:23
0
So let's continue there.
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
subject: Differences betweenabstract classes & interfaces