Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
    Bookmark Topic Watch Topic
  • New Topic

Differences betweenabstract classes & interfaces

 
Saral Saxena
Ranch Hand
Posts: 203
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Report post to moderator
HI fOLKS,
I want to know the practical and technical differences between the abstract classes and interfaces..?
 
Gamini Sirisena
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 203
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Pie
Posts: 20533
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
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.
 
    Bookmark Topic Watch Topic
  • New Topic