Win a copy of Create an Uber Clone in 7 Days: Build a real world full stack mobile app in Java this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Abstract Clas vs Interface  RSS feed

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Give me some practical scenario where should i use interface and where i ll go for abstarct class.
 
Ranch Hand
Posts: 2874
 
Ranch Hand
Posts: 456
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wrong forum mate...
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In layered programming go for interfaces.So that one team can make the layer with the interface without bothering about the implementation of that interface.
Abstract class is used to represent something in OO concept where someof the common implementation are common and some are case specific.So you can define the common functionalities as concrete and leave remaining as abstract to be implemented by the class which would extend this class.
 
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is asked at least once a week, why don't you search the archives (or better yet, get a decent book on software design principles)?
 
These are the worst of times and these are the best of times. And this is the best tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!