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;
第1题:
假设有以下代码: String s="hello"; String t="hello"; char c[ ]={'h','e','l','l','o'}; 下列选项中,返回false的语句是______。
A.s.equals(t);
B.t.equals(c);
C.s==t;
D.t.equals(new String("hello"));
第2题:
下面的程序执行后,屏幕上显示的应是 public class Exam{ public static void main(String[]args){ char char1[]={'t','e','s','t'}; char char2[]={'t','e','S','t','1'}; String s1=new String(char1); String s2=new String(char2,0,4); System.out.println(s1.equals(s2)); } }
A.true
B.false
C.test
D.编译错误
第3题:
A.Strings="Gonewiththewind";Stringt="good";Stringk=s+t;
B.Strings="Gonewiththewind";Stringt;t=s[3]+"one";
C.Strings="Gonewiththewind";Stringstandard=s.toUpperCase();
D.Strings="homedirectory";Stringt=s-"directory";
第4题:
下列哪个程序段可能导致错误?
A.String s="hello"; String t= "good"; String k=s+ t;
B.String s="hello"; String t; t=s[3]+"one";
C.String s="hello"; String standard=s. toUpperCase
D.String s="hello"; String t =s+ "good"
第5题:
A.s>>>=3;
B.int i=s.length();
C.s[3]=”x”;
D.String short_s=s.trim();
E.String t=”root”+s;
第6题:
给出下面的代码,则以下( )选项返回true。 String s="hello"; String t="hello"; Char c[]={'h','e','l','l','o'};
A.s. equals (t) ;
B.t. equals (C);
C.s==t;
D.t==c;
第7题:
A.s += "books";
B.char c = s[1];
C.int len = s.length;
D.String t = s.toLowerCase();
第8题:
下面的哪些程序段可能导致错误? ( ) Ⅰ: 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.Ⅲ、Ⅳ
第9题:
下列的哪个程序段可能导致错误? ( )
A.String s="hello"; String t="good"; String k=s+t;
B.String s="hello"; String t; t=s[3]+"one";
C.String s="hello"; String standard=s.toUpperCase();
D.String s="hello"; String t=s+"good";
第10题:
给出下列的代码,则以下哪个选项返回true? String s="hello"; String t="hello"; char c []= {'h','e','1','1','o'};A)s.equals(t);
A.t. equals(
B.;
C.s==t;
D.t==c;