• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

android.content.res.XmlResourceParser

 
Ranch Hand
Posts: 252
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What happened when you wrote a test case that contained both interface A and interface B that implements interface A?
 
Sheriff
Posts: 22701
129
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Nidhi Sar
Ranch Hand
Posts: 252
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 252
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
No. No. No. No. Changed my mind. Wanna come down. To see this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic