What method would you use, to simulate button’s click event, without any mouse activity

Q16. What method would you use, in order to simulate a button’s (namely OKBtn) click event, without any mouse activity from user’s side?

Ans. OKBtn.doClick();

What command do you need to write in actionPerformed() event handler of button, in order to make it exit button

Q15. What command do you need to write in actionPerformed() event handler of button, in order to make it exit button?

Ans. System.exit(0);