单项选择题
下面的哪些程序段可能导致错误 ( ) Ⅰ:String s="Gone with the wind"; String t="good"; String k=s+t; Ⅱ:String s="Gone with the wind"; String t; t=s[3]+"one"; Ⅲ:String s="Gone with the wind"; String standard=s.toUpperCase(); Ⅳ:String s="home directory"; String t=s-"directory";
A.Ⅱ、Ⅲ
B.Ⅱ、Ⅳ
C.Ⅰ、Ⅳ
D.Ⅲ、Ⅳ
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
设有如下程序: import java.util.*; public class Sun { public static void main (String args[ ]) { int score; String a; Random r=new Random (); score=r.nextInt (4)+5; switch(score) { case 0: a= E ; break; case 1: a= D ; break; case 2: a= C ; break; case 3: a= B ; break; default: a= A ; } System.out.println (A) ; } } 程序运行的结果是( )。
A.a="A"
B.a="E" a="A"
C.a="E"
D.a="C"
点击查看答案&解析
单项选择题
软件测试的目的是( )。
A.证明软件系统中存在错误
B.找出软件系统中存在的所有错误
C.尽可能多地发现软件系统中的错误和缺陷
D.证明软件的正确性
点击查看答案&解析
相关试题
请指出在顺序表{2、5、7、10、14、...
假设a是int类型的变量,并初始化为1,则下...
在JavaApplet程序用户自定义的Applet子类中...
Swing允许按自己的要求选择组件的外观和感...
算法的时间复杂度是指( )。