wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Is Exam Cram  correct or RHE correct? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Is Exam Cram  correct or RHE correct?" Watch "Is Exam Cram  correct or RHE correct?" New topic

Is Exam Cram correct or RHE correct?


Joined: Jun 12, 2000
Posts: 19
Which of the following AWT components can have a menu, either as a menu bar or pop-up menu, attached to it? (Exam Cram page.no 229, q.no 2)
a. java.awt.Frame
b. java.awt.Window
c. java.awt.Applet
d. java.awt.Panel
Answer shown as a,b,c and d.
But in RHE (page no. 341, q.no 8)
Which of the following may contain a menu bar?
a. A panel
b. A frame
c. An applet
d. A menu bar
e. A menu
Answer shown as only a Frame may contain menu bar.
So, which one is correct?
Ranch Hand

Joined: May 13, 2000
Posts: 56
Hello yojana,
The key difference between the two questions is "which can contain a menu, either as a menubar or popup menu" and "which can contain a menubar."
add( PopupMenu ) is defined in Component so Applet, Panel, Window and Frame (which have Component as a superclass) can all have PopupMenus.
setMenuBar( MenuBar ) is defined in Frame hence only Frame (and subclasses) can have a MenuBar.
Hence they're both right because they aren't asking the same thing.
Best regards,
Steve Butcher

jQuery in Action, 2nd edition
subject: Is Exam Cram correct or RHE correct?
Similar Threads
Menu Bar
Bill Brodgen's exam cram mock test, Q.no.28
AWT question
Which AWT component can contain a meu bar
MindQ q.no.37,42,45