• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Polygon's relation to Shape

 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the Java API (1.2.2), it states that Polygon extends Object and implements Shape, Serializable.
In the JQ+ quiz, it states that Polygon MUST extend Shape and NOT implement it.
Which is right? JQ Plus seems to cover the material fairly well...but seeing discrepencies like this just sucks.
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are they talking about java.awt.Polygon implementing public interface Shape? A class cannot extend an interface. A class can extend another class or implement an interface. An interface can extend another interface.

However if the question was about another class named Polygon extending a user class named Shape, that is entirely possible.
 
Mike Cunningham
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmmmm, I'll bounce back 50 questions and double check. Thanks.
 
reply
    Bookmark Topic Watch Topic
  • New Topic