This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
hi, Which cannot be added to a Container? a) Applet b) Component c)Container d) Panel e) MenuItem or Menu or MenuComponent. why is the answer e? I think none is the answer. or is the question supposed to be "cannot be directly added..."? then answer e) sounds right.... I am confused.
Hi Sean, You will understand, if you go through thr' hierarchy. Object->MenuComponent-> The sub classes of MenuComponent are MenuBar MenuItem Menu etc. Here Super class is not "Container" hence you can not add the above items to a Container. solaiappan
Wait a second here Component implements MenuContainer - inherited by Container. You can add a PopupMenu to any Component. The inheritance of Object->MenuComponent-> has nothing to do with it. Only a Frame can have a MenuBar, maybe thats what the question was trying to get at. Bill
Joined: Oct 20, 2000
Hi William, I thing the following explanation is ok. Container itself is a component, button,applet and component are component. But menu extends MenuComponent which extends Object so it is not a component. Hence Menu canot be added to a container. If am wrong, correct me. solaiappan.
[This message has been edited by P SOLAIAPPAN (edited October 29, 2000).]