[名词解释]

阅读代码

参考答案与解析:

相关试题

阅读下列代码publicclassPerson{staticintalt[]=n

[单选题]阅读下列代码 publicclassPerson{ staticintalt[]=newint[[10]; public static voidmain(Stringargs){ System.out.println{all[9]); } } 该代码的运行结果是( )。A.编译时将产生错误B.编译时正确,运行时将产生错误C.输出零D.输出空

  • 查看答案
  • 阅读下面代码class InterestTest ______ ActionLi

    [单选题]阅读下面代码 class InterestTest ______ ActionListener { … public void actionPerformed(ActionEvent event) { double interest=balance * rate/100: balance+=interest: NumberFormat format=NumberFormat.getCurrencyInstance(); System.out.printlb("balance="+Format

  • 查看答案
  • 阅读下列代码段ByteArrayOutputStream bout=new By

    [单选题]阅读下列代码段 ByteArrayOutputStream bout=new ByteArrayOutputStream(); ObjectOutputStream ut=new ObjectOutputStream(bout); out. writeObject(this); out. close(); 以上代码段的作用是A.将对象写入内存B.将对象写入硬盘C.将对象写入光盘D.将对象写入文件

  • 查看答案
  • 阅读下列代码段class TestimplementsRunnable{publ

    [单选题]阅读下列代码段 class TestimplementsRunnable{ publicintrun(){ inti=0; while(true){ i++; System.out.println("i="+1); } } } 上述代码的编译结果是( )。A.程序通过编译并且run()方法可以正常输出递增的i值B.程序通过编译,调用run()方法将不显示任何输出C.程序不能通过编译,因为while的循环控制条件不能为“true”D.程序不能通过编译,因为run()方法的返向值类型不是void

  • 查看答案
  • 阅读下面代码ByteArrayOutputStream bout=new Byt

    [单选题]阅读下面代码 ByteArrayOutputStream bout=new ByteArrayOutputStream(); ObjectOutputStream ut=new ObjectOutputStream(bout); out.writeObject(this); out.close();A.将对象写入内存B.将对象写入硬盘C.将对象写入光盘D.将对象写入文件

  • 查看答案
  • 阅读下列代码片段Class InterestTest________Action

    [单选题]阅读下列代码片段C.lass InterestTest________ActionListener{Public void actionPerformed (ActionEvent event) {D.ouble interest = balance * rate/100;B.alance += interest;Number Format format =Number Format.getCurrencyInstance ();System.out.printlb{ “ balance = ”

  • 查看答案
  • 阅读下列代码public class Test implements Runna

    [单选题]阅读下列代码 public class Test implements Runnable{ public void run(Thread t){ System. out. println("Running. "); } public static void main(String[]args){ Thread tt=new Thread(new Test()); tt. start(); } } 代码运行结果是A.将抛出一个异常B.没有输出并正常结束C.输出“Running”并正常结束D.程

  • 查看答案
  • 阅读下列代码public class Arrays{public static

    [单选题]阅读下列代码 public class Arrays{ public static void main(String[]args){ int[]a=new int[5]; for(int i=0;i<a. length; i=i+1){ a[i]=10+i; } for(int i=0; i<a. length; i=i+1){ System. out. println(a[i]); } String[]s={"Frank","Bob","Jim"}; for(int i=0; i<

  • 查看答案
  • 阅读下列代码public class Jixiangwu{ public sta

    [单选题]阅读下列代码 public class Jixiangwu{ public static void main(String[]args){ String[]stars={"贝贝","晶晶","欢欢","迎迎","妮妮"}; System. out. println("你抽取的奥运吉祥物是"+"“" +stars[(int)(stars. ______* Math. random())]+"”"+"!"); } } 为保证程序能正确执行,程序中下画线处应填写的是

  • 查看答案
  • 阅读下列代码片段class InterestTest______ActionLi

    [单选题]阅读下列代码片段 class InterestTest______ActionListener{ public voidactionPerformed(ActionEventevent){ double interest=balance*rate/100; balance+=interest; NumberFormat format=Number Format.getCurrencylnstance(): System.out.print]b("balance="+formatter.for

  • 查看答案
  • 阅读代码