wood burning stoves 2.0*
The moose likes Java in General and the fly likes Differences betweenabstract classes & interfaces Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic
Author

Differences betweenabstract classes & interfaces

Saral Saxena
Ranch Hand

Joined: Apr 22, 2011
Posts: 202

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

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
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

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: 19651
    
  18

Hebert Coelho wrote:No need to open two topics almost indenticals.

http://www.coderanch.com/t/561659/java/java/abstract-class-Vs-Interface-real

So let's continue there.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
 
subject: Differences betweenabstract classes & interfaces
 
Similar Threads
abstract classes vs interfaces
Abstract classes and Interfaces
abstract class and interface
Abstract classes and interface
Class Inheritance and Interface Inheritance