下列的哪个程序段可能导致错误?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";

下列的哪个程序段可能导致错误?

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";


相关考题:

下面的哪些程序段可能导致错误? ( ) Ⅰ: 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.Ⅲ、Ⅳ

假设有以下代码: 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"));

下列语句中错误的是A.String s[]={"how","are"};B.byte b=255;C.String s="one"+"two";D.int i=2+2000;

给出下面的代码,则以下( )选项返回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;

已知String str=new String ("Luck");,则下列关于str的操作中不合法的是( )。A.String s=str. toUpperCase()B.int i=Str. length;C.char s=str. charAt(2);D.String s="Good" +str;

下列程序段运行的结果为 public class Test{ static void print(String s,int i){ System.out.println("String:"+s+",int:"+i); } static void print(int i,String s){ System.out.println("int:"+i+",String:"+s); } public static void main(String[]args){ print(99,"Int first"); } }A.String:String first,int:11B.int:11,String:Int firstC.String:String first,int99D.int:99,String:Int first

下面的程序执行后,屏幕上显示的应是 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.trueB.falseC.testD.编译错误

下列的哪个程序段可能导致错误? ( )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";

下列哪个程序段可能导致错误?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. toUpperCaseD.String s="hello"; String t =s+ "good"

给出下列的代码,则以下哪个选项返回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;

下列程序段运行的结果为 public class Test{ static void print(String s,int i){ System.out.println("String:"+s+",int:"+i); } static void print(int i, String s){ System.out.println("int:"+i+",String:"+s); } public static void main(String [] args){ print(99,"Int first"); } }A.String:Stringfirst,int:11B.int:11,String:Int firstC.String:String first,int:99D.int:99,String:int first

下面的程序执行后,屏幕上应显示______。 public class Test{ 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.trueB.falseC.testD.编译错误

下列程序执行后,屏幕上显示的应是 public class Testyyy {public static void main(String[]args) {char charl[]={,'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.trueB.假C.testD.编译错误

给出下列的代码则以下哪个选项返回true? String s = "hello" ; String s = "hello" ; char c[] = { 'h' ,'e','l','o'};A.s.equals(t);B.t.equals(c);C.s = =tD.t = = c;

3下列程序段运行的结果为( )。 public class Test{ static void print(String s,int i){ System.out.pdntlnC String: "+s+",int:"+i); } static void print(iht i,String s){ System.out.prinflnCint:"+i+",gtring:"+s); } public static void main(String[] args){ print(99,"Int first"); } }A.String:String first,int: 11B.int: 11,String:Int firstC.String:String first,int:99D. int:99,Stfing:Int first

下列的( )程序段可能导致错误。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";

给出下列的代码,则以下( )选项返回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;

给出下面程序: public class ex51 { public static void main(String[] args) { String s = "hello"; String t = "hello"; char c[] = {'h', 'e', '1', '1', 'o'}; System. out. println (______) } } 在程序的横线处填入下列______选项后,程序输出的结果是true。A.t.equals(c)B.s.equals?C.s == tD.t == c

下面的哪些程序片断可能导致错误() 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、 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";

有语句String s=”hello world”; ,以下操作哪个是不合法的()A、int i=s.length();B、s=3;C、String ts=s.trim();D、String t=s+”!”

String s= "hello";     String t = "hello";  char c[] = {’h’,’e’,’l’,’l’,’o’} ;     Which return true?()   A、 s.equals(t);B、 t.equals(c);C、 s==t;D、 t.equals(new String("hello"));E、 t==c;

Which of the following fragments might cause errors?()    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";

多选题String s= "hello";     String t = "hello";  char c[] = {’h’,’e’,’l’,’l’,’o’} ;     Which return true?()As.equals(t);Bt.equals(c);Cs==t;Dt.equals(new String(hello));Et==c;

多选题下面哪段语法执行正确()AString s = Gone with the wind;String t =  good ;String k = s + t;BString s = Gone with the wind;String t; t = s[3] + one;CString s = Gone with the wind;String standard = s.toUpperCase();DString s = home directory;String t = s - directory;

多选题Which of the following fragments might cause errors?()AString s = Gone with the wind;String t =  good ;String k = s + t;BString s = Gone with the wind;String t;t = s[3] + one;CString s = Gone with the wind;String standard = s.toUpperCase();DString s = home directory;String t = s - directory;

多选题下面的哪些程序片断可能导致错误()AString s = Gone with the wind;  String t =  good ;  String k = s + t;BString s = Gone with the wind;  String t;  t = s[3] + one;CString s = Gone with the wind;  String standard = s.toUpperCase();DString s = home directory; String t = s - directory