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题:
A.s>>>=3;
B.int i=s.length();
C.s[3]=”x”;
D.String short_s=s.trim();
E.String t=”root”+s;
第2题:
下列的哪个程序段可能导致错误? ( )
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";
第3题:
给出下列的代码则以下哪个选项返回true? String s = "hello" ; String s = "hello" ; char c[] = { 'h' ,'e','l','o'};
A.s.equals(t);
B.t.equals(c);
C.s = =t
D.t = = c;
第4题:
下列的( )程序段可能导致错误。
A.String s="hello": Sting t="good"; String k=s+t;
B.Sting s="hello"; String t; t=s [3] + "one";
C.Sting s="hello"; String standard=s.toUpperCase( );
D.String s="hello": Stringt s +"good";
第5题:
下面的哪些程序片断可能导致错误()
第6题:
Strings="This is the";Stringt=s.concat("String.");t的内容是()
第7题:
现有: import java.util.*; class AddStuff2 { public static void main(String [] args) { TreeSet
第8题:
Which of the following fragments might cause errors?()
第9题:
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”;
第10题:
string()
string(constchar*s)
string(conststring&str)
string(size_typen,charc)
第11题:
1
2
3
4
5
6
第12题:
String s1=null;
String s2=’null’;
String s3=(String)‘abc’;
String s4=(String)‘/uface’;
第13题:
有以下等程序#include <string. h>void f(char *s, char *t){ char k; k=*s; *s=*t; *t=k; s++; t--; if(*s) f(s, t);}main (){ char stt[10] ="abcdefg", *p; p=str+strlen (str)/2+1; f (p,p-2); print f ( "%s\n", str);}
A.abcdefg
B.gfedcba
C.gbcdefa
D.abedcfg
第14题:
下列哪个程序段可能导致错误?
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"
第15题:
下面的程序执行后,屏幕上显示的应是 public class Exam{ public static void main(String[]args){ char char1[]='t','e','s','t'}; char char2[]={'t','e','s','t','1',}; String sl=new String(char1); String s2=new String(char2,0,4); System.out.println(S1.equals(s2)); } }
A.真
B.假
C.test
D.编译错误
第16题:
下列的哪个程序段可能导致错误?
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";
第17题:
public String makinStrings() { String s = “Fred”; s = s + “47”; s = s.substring(2, 5); s = s.toUpperCase(); return s.toString(); } How many String objects will be created when this method is invoked?()
第18题:
有语句String s=”hello world”; ,以下操作哪个是不合法的()
第19题:
String s= "hello"; String t = "hello"; char c[] = {’h’,’e’,’l’,’l’,’o’} ; Which return true?()
第20题:
int i=s.length();
s>>>=3;
String ts=s.trim();
String t=s+”!”
第21题:
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;
第22题:
String regex = ;
String regex = ;
String regex = .*;
String regex = //s;
String regex = //.//s*;
第23题:
s.equals(t);
t.equals(c);
s==t;
t.equals(new String(hello));
t==c;