• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

Abstract classes and interfaces

 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
what are the differences between an abstract class and interface
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The following articles might help:
http://www.javaworld.com/javaqa/2001-04/03-qa-0420-abstract_p.html
http://www.javaworld.com/javaworld/javaqa/2001-08/03-qa-0831-interface.html
 
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic