This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes interface implements interface? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "interface implements interface?" Watch "interface implements interface?" New topic
Author

interface implements interface?

jaspreet atwal
Ranch Hand

Joined: Sep 05, 2007
Posts: 52
I think I am overlooking a very basic concept here... Why can't we have an Interface that implements an Interface? Or is it that Interfaces should always be top level, there cannot be an Interface somewhere in between a hierarchy tree?



Still Learing..
Deepa Neela
Greenhorn

Joined: May 01, 2008
Posts: 6
interface extends another interface but not implements it, because interface will not contain the implementation (you cannot provide implementation in the interface). So you can just extend it but not implement it.
Garrett Rowe
Ranch Hand

Joined: Jan 17, 2006
Posts: 1296
Implements denotes defining an implementation for the methods of an interface. However interfaces have no implementation so that's not possible. An interface can however extend another interface, which means it can add more methods and inherit its type.


Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
jaspreet atwal
Ranch Hand

Joined: Sep 05, 2007
Posts: 52
Garret and Deepa,
Thank you!! That answers my question.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

"Deepa",
Please check your private messages regarding an important administrative matter.
-Ben
[ May 06, 2008: Message edited by: Ben Souther ]

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Mayu Mayooresan
Ranch Hand

Joined: Mar 12, 2011
Posts: 37

This is my understanding.....

When you implement an Interface to a class you must re-declare all the class and fill them up. Which is not possible in Interface as Interfaces are abstract. So You can't implement an interface to another interface but you can happily extend.

Correct me if my perception is wrong.

Thanks.
 
GeeCON Prague 2014
 
subject: interface implements interface?