File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

asking about interface 2

 
kumar abhay
Ranch Hand
Posts: 53
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question v:-Why multiple inheritance is is possible by interface rather than inheritance(by extends keyword).what is the purpose of introducing interface.what is that which we can not do in inheritance but in interface
Question vi:-Interface can not be protected but only public .why?
 
Marilyn de Queiroz
Sheriff
Posts: 9059
12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question v:-what is that which we can not do in inheritance but in interface

It is rather a question of what problems are eliminated by using interface rather than multiple inheritance.

Superficially, multiple inheritance looks attractive. However, having multiple superclasses means inheriting the implementation of each, which is problematic. Resolving conflicts among the multiple implementations can be difficult or impossible. If you don't think it's complex, look at the virtual base classes in C++.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic