题目内容

下列叙述错误的是( )

A. Integer.parselnt ("12.9");会触发NumberFormatException异常
B. 表达式"bird".contentEquals ("bird")的值是true
C. 表达式"Bird"=="bird"的值是false
D. new String("bird")==("bird")的值是true

查看答案
更多问题

对于如下代码,叙述正确的是()public class E {public static void main (String args[]) {String s1 = args[1];String s2 = args[2];String s3 = args[3];System.out.println(s3);}}

A. 程序出现编译错误
B. 无编译错误,在命令行执行程序:“java E I love this game”,程序输出this
C. 无编译错误,在命令行执行程序:“java E let us go”,程序无运行异常
D. 无编译错误,在命令行执行程序:“java E 0 1 2 3 4 5 6 7 8 9”,程序输出3

挑错题:A、B、C、D注释标注的哪行代码有错误?public class E {public static void main (String[]args) {String str = new String("ABCABC");int m = str.equals(""); //Abyte [] b = str.getBytes(); //BString s = str.substring(1); //Cchar []c = str.toCharArray(); //D}}

A
B
C
D

挑错题:下列A、B、C、D注释标注的哪行代码有错误?public class E {public static void main (String[]args) {String str1 = new String(""); //Aint [] a = {97,98,99};String str2 = new String (a); //Bchar [] c = {'a','b','c'};String str3 = new String (c); //CString str4 = new String(); //DSystem.out.println(str4.equals(""));}}

A
B
C
D

阅读程序题:给出下列【代码】注释标注的代码的输出结果。public class E {public static void main (String[]args) {String str = new String ("苹果");modify(str);System.out.println(str); //【代码】}public static void modify (String s) {s = s + "好吃";}}

答案查题题库