下面关于接口Collection中声明的方法哪个是不正确的?( )
A. 添加元素的add(Object obj) 方法
B. 删除元素的remove(Object obj)方法
C. 得到元素个数的length()方法
D. 返回迭代器的iterator()方法,迭代器用于元素遍历
对于下列程序,哪个叙述是正确的?()
A. JVM认为这个应用程序共有两个线程。
B. JVM认为这个应用程序只有一个主线程。
C. JVM认为这个应用程序只有一个thread线程。
D. thread的优先级是10级。public class
E. { public static void main(String args[]) { Target target =new Target(); Thread thread =new Thread(target); thread.start(); }}class Target implements Runnable{ public void run(){ System.out.println("ok"); }}
为了向文件hello.txt尾加数据,下列哪个是正确创建指向hello.txt的流?( )
A. try { OutputStream out = new FileOutputStream ("hello.txt"); } catch(IOException e){}
B. try { OutputStream out = new FileOutputStream ("hello.txt",true); } catch(IOException e){}
C. try { OutputStream out = new FileOutputStream ("hello.txt",false); } catch(IOException e){}
D. try { OutputStream out = new OutputStream ("hello.txt",true); }catch(IOException
E. {}
下面说法错误的是:( )
A. 单击JCheckBox (复选框)产生ItemEvent事件,并由ItemListener处理。
B. 处理JButton和JTextField事件监听器接口都可以是ActionListener。
C. 处理鼠标事件的事件监听器接口只有MouseListener。
D. 在JTextField和JPasswordField中输入数据后按Enter键会激发一个事件。