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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Layout Management" Watch "Layout Management" New topic
Author

Layout Management

Engin Okucu
Ranch Hand

Joined: Feb 09, 2002
Posts: 174
In the book of Khalid A.Mughal , there is a question as it :
Which of these methods are not available in an instance of the Container class ? :

(a) Component add(Component comp)
(b) Component add(Component comp,int index)
(c) void add(Object constraints,Component comp)
(d) void add(Component comp, Object constraints,int index)
(e) void add(PopupMenu popup)
for me the answer is c and d, but the correct anszer ic only c in the book and there is an explanation where it says so method (e) is inherited from Component. therefore e is so wrong.....
I do a mistake ? can you tell about it.
Thanks.
Brian Lugo
Ranch Hand

Joined: Nov 10, 2000
Posts: 165
Did you check out the API?
Brian
Corey McGlone
Ranch Hand

Joined: Dec 20, 2001
Posts: 3271
Indeed, check the API Spec for the Container class.
As for answer E, as that method is inherited from Component, that method is available through an instance of Container, even though it isn't defined within Container.
If you have more questions, please ask.
I hope that helps,
Corey


SCJP Tipline, etc.
Engin Okucu
Ranch Hand

Joined: Feb 09, 2002
Posts: 174
Sorry in first i wanted to say for me the answer is C and E !!! but only C in the answer .....why not E ???
Engin Okucu
Ranch Hand

Joined: Feb 09, 2002
Posts: 174
Corey thanks... i did look at the API that you 've linked...then it's inherited from Component class since Container class is a subclass of Component, you're right !
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Layout Management
 
Similar Threads
JScrollPane & JPanel dynamic changes
Expand/Collapse Panels
add() method for components
JQ+:Question ID :954959231549
why