Answer to Question #194905 in Java | JSP | JSF for Bill

Question #194905

* Please select the correct letter choice "A, B, C, D, or E"


8. Given the following code, which can add an "event handler" to "button1"?

JButton button1 = new JButton();


A.

button1.ActionListener( new ActionListener() {

public void actionPerformed(ActionEvent e) { }

} );


B.

button1.addActionListener( new ActionListener() {

public void actionPerformed(ActionEvent e) { }

} );


C.

button1.addActionListener( new ActionListener() {

public void addActionPerformed(ActionEvent e) { }

} );


D.

button1.addActionListener( new ActionListener() {

public void Performed(ActionEvent e) { }

} );


E. All of the options


1
Expert's answer
2021-05-24T07:41:54-0400

B


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS