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”;
举一反三
- 已知Strings=“Java”,则下面哪些代码是正确的() A: s=s+1; B: charc=s[3]; C: inti=s.length; D: Stringt=s+newObject();
- (10_3)有语句Strings=”helloworld”,以下操作合法的是()。 A: inti=s.length(); B: Strings2=s.trim(); C: s>>>=3; D: Stringt=s+”!;”
- 下面的哪些程序片断可能导致错误() A: String s = "Gone with the wind"; String t = " good "; String k = s + t; B: String s = "Gone with the wind"; String t; t = s[3] + "one"; C: String s = "Gone with the wind"; String standard = s.toUpperCase(); D: String s = "home directory"; String t = s - "directory"
- 下面的表达式中正确的是() A: Strings=“你好”;inti=3;s+=i; B: Strings=“你好”;inti=3;if(i==s)s+=i; C: Strings=“你好”;inti=3;s=i+s; D: Strings=“你好”;inti=3;s=i+;
- 下面的表达式哪些是正确的?() A: Strings="你好";inti=3;s+=i; B: Strings="你好";inti=3;if(i==s){s+=i}; C: Strings="你好";inti=3;s=i+; D: Strings="0";inti=(s!=null)&&(s.length()>0)?s.length():0;
内容
- 0
It's cash given with no strings touched.
- 1
下面的哪些程序片断可能导致错误?( ) A: String s=”Hello”; String t=,,World"; String k=s+t; B: String s=,,Hello";String t;t=s[3]+"one"; C: String s="Hello,,;String standard = s.tollpperCase(); D: String s="Hello World”;String t=s-”World”;
- 2
下面的哪些程序片断可能导致错误?( )。 A: String s="Gone with the wind";String t;t=s[3]+"one"; B: String s="Gone with the wind";String t="good";String k=s+t; C: String s="Gone with the wind";String standard=s.toUpperCase(); D: String s="home directory";String t=s-"directory";
- 3
给定如下Java代码,编译运行时,以下()语句的值是true。 Strings=”hello”; Stringt=”hello”; Stringe=newString(”hello”); charc[]={‘h’,e’,’l’,’l’,o’};
- 4
Java中,以下代码会报错会报错的两项是() A: String s = "Gone with the wind"; String t = " good "; String k = s + t; B: String s = "Gone with the wind"; String t; t = s[3] + "one"; C: String s = "Gone with the wind"; String standard = s.toUpperCase(); D: String s = "home directory"; String t = s - "directory";