单项选择题
请阅读下面程序
public class ExampleStringBuffer
public static void main(String []args)
StringBuffer sb=new StringBuffer("test");
System.out.println("buffer="+sb);
System.out.println("length="+sb.length());
程序运行结果中在"length="后输出的值是( )。
A.10
B.4
C.20
D.30
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
请阅读下面程序,说明该程序创建线程使用的方法是( )。 public class ThreadTest public static void main(String args[]) Thread tl=new Thread(new HolloWorld()); Thread t2=new Thread(new HolloWorld()); t1.start(); t2.start(); class HolloWorld implements Runnable int i; public void run() while(true) System.out.println( HolloWorld +i++); if(i==5)break;
A.继承Thread类
B.实现Runnable接口
C.t1.start()
D.t2.start()
点击查看答案&解析
单项选择题
下列事件监听器中,无法对TextField对象进行事件监听和处理的是( )。
A.ActionListener
B.FocusListener
C.MouseMotionListener
D.ChangeListener
点击查看答案&解析
相关试题
在下列程序的下画线处,填入适当语句使程序...
MouseDragged()方法是MouseMotionListene...
阅读下列代码 public class Test2 pub...
设a=8,则表达式a>>>2的值是____...
当实现Runnable接口时,要实现的方法是__...