String s="123";
String sl=s+456;
请问sl的结果是
举一反三
- 设有以下代码:String sl="123"; String s2="123"; String s3=new String("123");则表达式s1==s2和s1==s3的值分别是( ) A: true,true B: false,false C: true,false D: false,true
- 下列代码片段执行结果是:String s=new String(”abc”); String s1=new String(s); if(s==s1){ System.out.println(”Hello”); } if(s.equals(s1)){ System.out.println(”World”); } A: Hello World B: Hello C: World D: Null
- 下面代码的输出结果是0。 String s = new String(); System.out.println(s.length());
- 读代码:public class foo {static String s;public static void main (String[]args) {System.out.println (“s=” + s);}}结果是
- 请说出下列代码的执行结果 : String s = "abcd"; String s1 = new String(s); if (s = = s1) System.out.println("the same"); if (s.equals(s1)) System.out.println("equals");
内容
- 0
下面的代码片段中正确的是那一项? A: String s=″你好″;int i=3;i+=s; B: String s=″你好″;int i=3;if(i==s){s+=i}; C: String s=″你好″;int i=3;s=i+s; D: String s=″你好″;int i=3;s=i+;
- 1
以下程序代码的输出结果是( ) String s=new String("abcdef"),t=new String("123"); System. out. println((concat(s,t)). length()); A: 9 B: 10 C: 6 D: 出错
- 2
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";
- 3
定义string s=”123”字符串,并执行代码s=s+”4”,此时内存中有_____个字符串
- 4
已知G4=(VT{a,’,’,(,)},VN={S,L,L’},S,P),其中P为, S→(L)|a|ε L→SL’ L’→,SL’|ε FIRST(SL’)是(29)。 A: {’,’,ε} B: {(,a} C: {(,a,’,’) D: {(,a,’,’ ,ε)