Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Interface

 
selvas kumars
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai,
Can anybody explain me why interface is used in java other than solving the problem of multiple inheritance..
I am looking in terms of communication between objects.
regards,
silva.
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by selvas kumars:
Can anybody explain me why interface is used in java other than solving the problem of multiple inheritance..
I am looking in terms of communication between objects.

Pluggable architectures -- swap a class for any other class that implements the same interface. (Of course, you can work around the lack of interfaces in C++ by using multiple inheritance... )
- Peter
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic