[单项选择题] 选择正确的语句填在下列程序的横线处。import java.awt.*;import java.awt.event.*;public class ex30{ Frame f; public static void main(String[] args) { ex30 e = new ex30(); e. te st ( ); } public void test() { f = new Frame("ex30"); ______ f.paok(); f.setVisible(true); } class MyWindowListener extends WindowAdapter { public void windowClosing(WindowEvent e){ System.exit(1);} } }
A.addWindowListener(new MyWindowtistener());
B.addWindowListener(MyWindowListener());
C.addWindowAdapter(new MyWindowListener());
D.addWindowListener(new MyWindowListener());