This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Menu Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Menu" Watch "Menu" New topic



Joined: Sep 20, 2000
Posts: 11
The Component class implements the MenuContainer interface,why Frame class continue to implement the MenuContainer interface.I think Frame extneds from Component class,it automatically have the property of MenuContainer.So the other subclasses of Compoent can add Menu in their container.True of False.Why?
Thank you.
Mapraputa Is
Leverager of our synergies

Joined: Aug 26, 2000
Posts: 10065
IMHO the best answer (by maha anna)is here

Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
Jerry Pulley
Ranch Hand

Joined: Sep 19, 2000
Posts: 221
Maha Anna's post gives an explanation for the specific case of menus, but can anybody give a more general explanation? I'll rephrase the question:
What is the point of implementing an interface in a subclass when a superclass has already implemented that interface?
I've seen this construct used in other places in the core library. For instance, <code>AbstractList</code> implements the <code>List</code> interface and so do <code>ArrayList</code> and <code>LinkedList</code>, both of which inherit from <code>AbstractList</code>. Here's another example from the Collections API - <code>AbstractMap</code> implements <code>Map</code> and so do <code>HashMap</code> and <code>WeakHashMap</code>.
In all 3 of these examples (counting the menu classes), the topmost implementor is <code>abstract</code> and the subclasses are not. Does this have something to do with it?
I agree. Here's the link:
subject: Menu
It's not a secret anymore!