Multiple Choice
Consider the following code snippet:
Public class ClickListener implements ActionListener
{
Public void actionPerformed(ActionEvent event)
{
System.out.println("I was clicked.") ;
}
}
Public class ButtonTester
{
Public static void main(String[] args)
{
JFrame frame = new JFrame() ;
JButton button = new JButton("Click me!") ;
Frame.add(button) ;
ActionListener listener = new ClickListener() ;
Button.addActionListener(listener) ;
) ..
}
}
Which of the following statements is correct?
A) Class ButtonTester is an interface type.
B) A ClickListener object listens for the action events that buttons generate.
C) Class ClickListener is an interface type.
D) Class ButtonTester implements an interface type.
Correct Answer:

Verified
Correct Answer:
Verified
Q1: If a text field holds an integer,
Q2: When a component is added to a
Q6: To respond to a button event, a
Q6: When drawing complex shapes, make a separate
Q9: Which of the following statements creates a
Q10: Which statements will create an editable text
Q11: When an event occurs, the event source
Q14: Consider the following code snippet:<br>Import _<br>Import java.awt.event.ActionListener;<br>/**<br>An
Q17: Based on the following statement, which of
Q53: The methods of a/an _ describe the