Multiple Choice
If the method makeMenuItem is called four times, how many MyMenuListener objects will be created?
public JMenuItem makeMenuItem(String menuLabel)
{
JMenuItem mi = new JMenuItem(menuLabel) ;
class MyMenuListener implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
doSomething() ;
}
}
mi.addActionListener(new MyMenuListener() ) ;
return mi;
}
A) 1
B) 2
C) 3
D) 4
Correct Answer:

Verified
Correct Answer:
Verified
Q59: The code below will not compile successfully
Q60: Which of the following is false about
Q61: a(n. _ is used when you have
Q62: Examine the code below.What type of class
Q63: What is known for certain from this
Q65: You can add a(n) _ to a
Q66: When a menu item is selected, what
Q67: Which method can a program use to
Q68: The JFrame has a content pane with
Q69: The statement that would add smallButton to