• Post Reply Bookmark Topic Watch Topic
  • New Topic

Of what use are interfaces?  RSS feed

 
deen john
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Except just adding some more methods out of hirearchy, what are the uses of interfaces in java? short example please
 
dennis deems
Ranch Hand
Posts: 808
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An interface insulates consumers from details that could change, and conceals things which might be none of their business. It allows you to swap out an implementation without causing ripple effects in the consuming code. It allows objects to be classified by their behaviors instead of their membership of a class hierarchy - which gives you lots of power and flexibility.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66304
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please SearchFirst. This question has been asked countless times; this post, for example.
 
deen john
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks. could you explain by any short example please
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Please SearchFirst.

deen, did you follow what bear said? okay how about this ? still you can find lot here in javaranch
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!