Examine the code below.What type of class is MyMenuListener?
public JMenuItem makeMenuItem(String menuLabel)
{
JMenuItem mini = new JMenuItem(menuLabel) ;
class MyMenuListener implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
doSomething() ;
}
}
mini.addActionListener(new MyMenuListener() ) ;
return mi;
}
A) It is an anonymous class
B) It is an inner class
C) It is a JMenuItem subclass
D) It is a JMenu class
Correct Answer:
Verified
Q53: Based on the statement below, which of
Q54: Which of the following defines the job
Q55: Which of the following adds a border
Q56: When a menu item is selected, what
Q57: When the user selects a menu item,
Q59: Given four JRadioButton objects in a ButtonGroup,
Q60: What is the container for top-level menu
Q61: For a new programmer using the Swing
Q62: What is the general order of a
Q63: Which code will create a JSlider with
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents