Solved

Consider the Following Code Snippet

Question 83

Multiple Choice

Consider the following code snippet:
Class MouseClickedListener implements MouseListener
{
Public void mouseClicked(MouseEvent event)
{
Int x = event.getX() ;
Int y = event.getY() ;
Component.moveTo(x,y) ;
}
Public void mousePressed(MouseEvent event) {}
Public void mouseEntered(MouseEvent event) {}
Public void mouseExited(MouseEvent event) {}
}
What is wrong with this code?


A) The class cannot have empty methods for the mousePressed, mouseEntered, and mouseExited methods.
B) The class failed to implement the mouseReleased method of the MouseListener interface.
C) The class has implemented the wrong interface.
D) The mouseClicked method cannot access the x and y coordinates of the mouse.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents