• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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: 43026
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?
 
Marshal
Posts: 22450
121
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
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic