Which of the following statements is for terminating the program when closing the frame?

Which of the following statements is for terminating the program when closing the frame?


A. frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
B. frame.setDefaultCloseOperation(null)
C. frame.setDefaultCloseOperation(JFrame.STOP_ON_CLOSE)
D. frame.setDefaultCloseOperation(JFrame.TERMINATE_ON_CLOSE)

The correct answer is A


Java

Learn More Multiple Choice Question :