Which of the following statements is used to terminate the program when closing the frame?
A.frame.setDefaultCloseOperation(null);
B.frame.setDefaultCloseOperation(JFrame.STOP_ON_CLOSE);
C.frame.setDefaultCloseOperation(JFrame.TERMINATE_ON_CLOSE);
D.frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);