File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Container Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Container" Watch "Container" New topic
Author

Container

sean cee
Ranch Hand

Joined: Oct 24, 2000
Posts: 115
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.

Thanks heaps


Sean <br />SCJP2, SCJP2p1.4, SCWCD
P SOLAIAPPAN
Ranch Hand

Joined: Oct 20, 2000
Posts: 68
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
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12779
    
    5
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
P SOLAIAPPAN
Ranch Hand

Joined: Oct 20, 2000
Posts: 68
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).]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Container