Solved

Consider the Following Code Snippet

Question 63

Multiple Choice

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


A) The mouseClicked method cannot access the x and y coordinates of the mouse.
B) repaint() method was not called.
C) The class has implemented the wrong interface.
D) There is nothing wrong with this code.

Correct Answer:

verifed

Verified

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

Related Questions