This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Polygon's relation to Shape Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Polygon Watch "Polygon New topic
Author

Polygon's relation to Shape

Mike Cunningham
Ranch Hand

Joined: Nov 14, 2000
Posts: 129
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.
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
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.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Mike Cunningham
Ranch Hand

Joined: Nov 14, 2000
Posts: 129
Hmmmm, I'll bounce back 50 questions and double check. Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Polygon's relation to Shape