aspose file tools*
The moose likes Java in General and the fly likes android.content.res.XmlResourceParser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "android.content.res.XmlResourceParser" Watch "android.content.res.XmlResourceParser" New topic
Author

android.content.res.XmlResourceParser

Nidhi Sar
Ranch Hand

Joined: Oct 19, 2009
Posts: 252

I guess this is a basic java question, but I'm posting it here because the interface is an Android interface.

So I was looking at android.content.res.XmlResourceParser . Apparently, this is the definition in the online API on Android developer site:

public interface XmlResourceParser implements AttributeSet XmlPullParser

How is this possible? Is this an error?
How can an interface IMPLEMENT another interface (or two)? Shouldn't it EXTEND them?


"A problem well stated is a problem half solved.” - Charles F. Kettering
SCJP 6, OCPJWCD
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41506
    
  53
What happened when you wrote a test case that contained both interface A and interface B that implements interface A?


Ping & DNS - my free Android networking tools app
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19670
    
  18

You're right Nidhi, an interface cannot implement other interfaces but only extend them. I don't think this is a fault in the source code. Instead, the API doc generator seems to have a small bug in it, where it puts all "parent" interfaces into an "implements" list, even if the current class is an interface itself.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Nidhi Sar
Ranch Hand

Joined: Oct 19, 2009
Posts: 252

Ulf Dittmer wrote:What happened when you wrote a test case that contained both interface A and interface B that implements interface A?


A compilation error ofcourse, as expected..... that's why this "official Google" documentation threw me off.
Nidhi Sar
Ranch Hand

Joined: Oct 19, 2009
Posts: 252

Rob Spoor wrote:You're right Nidhi, an interface cannot implement other interfaces but only extend them. I don't think this is a fault in the source code. Instead, the API doc generator seems to have a small bug in it, where it puts all "parent" interfaces into an "implements" list, even if the current class is an interface itself.


Thanks Rob. I thought I was going crazy
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: android.content.res.XmlResourceParser