填空题

凡生成StringBuffer一个对象后,还可用【 】方法或ensureCapacity( )方法来设定缓 存大小。

【参考答案】

setLength( )
<上一题 目录 下一题>
热门 试题

单项选择题
下列代码的执行结果是( )。public class Test{public int aMethod( ) {static int i=0;i+ +;System.out.println(i);} public static void main(String args[ ]){Test test = new Test( );test.aMethod( );}}
A.编译错误
B.0
C.1
D.运行成功,但不输出
填空题
下列是一个Java Applet程序,填空使它的功能为计算数组各元素和的平均值。import java applet. * ;import java awt. * ;public class Testvv extends Applet{pubfic void paint(Graphics g){int a[ ]= { 1,3,5,7,9,10 };double total=0.0,ave=0.0;for(int i=0;i<a.length;i++)total+=a[i];ave=total 【 】;g.drawstring( ave= +ave,30,60);}}
相关试题
  • 阻塞状态根据产生的原因可分为【 】、等待...
  • 构造方法是类中的一种特殊方法,用它来定义...
  • 下列程序的输出结果是【 】。class Test...
  • 设x,y,max均为int型变量,x,y已赋值。用...
  • 在定制Swing Applet的绘图功能时,不能直...