1.

Which of these methods will respond when you click any button by mouse?(a) mouseClicked()(b) mouseEntered()(c) mousePressed()(d) all of the mentionedI have been asked this question in an internship interview.The question is from Event Listeners Interfaces topic in division Event Handling of Java

Answer»

The correct answer is (d) all of the mentioned

Best explanation: when we click a button, FIRST we enter the region of button hence mouseEntered() method RESPONDS then we press the button which leads to RESPOND from mouseClicked() and mousePressed().



Discussion

No Comment Found

Related InterviewSolutions