• Post Reply Bookmark Topic Watch Topic
  • New Topic

Abstract classes and interfaces  RSS feed

 
feroz muhamed
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
what are the differences between an abstract class and interface
 
Rahul JG
Ranch Hand
Posts: 44
 
James Clinton
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BIG DIFFERENCE:
If you use a abstract class to force your child classes to implement a function, then depending on your system, the function will not be visible to the clients (you may or may not want this). RMI is a good example of this where interfaces must be used to expose services to clients.
Note. this is not an either or issue, they should be used inconjunction with each other. See strat pattern below.
http://www.javaworld.com/javaworld/jw-04-2002/jw-0426-designpatterns-p1.html
http://www.javaworld.com/columns/jw-java-design-patterns-index.shtml
Hope that helps.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!