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

有语句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'}; 下列选项中,返回false的语句是______。A.s.equals(t);B.t.equals(c);C.s==t;D.t.equals(new String("hello"));

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

下列程序执行后,字符串s应是 String greets="hello"; String s=greets.substring(0,3);A.elloB.hellC.helloD.hl

以下选项中正确的语句组是( )。A)char s[];s="HELLO!";B)char*s;s={"HELLO!"};C)char s[10];s="HELLO!";D)char *s;s="HELLO!";

顺序执行下列程序语句后,则b的值是 String a="Hello"; String b=a.substring(0,2);A.HelloB.helloC.HeD.null

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

String s = "Hello";s = s + " world!";这两行代码执行后,原始的String 对象中的内容到底变了没有?

以下选项中正确的语句组是( )。A.char s[]; s="HELLO!";B.char *s; s={"HELLO!"};C.char s[10]; s="HELLO!";D.char *s; s="HELLO!";

写出程序运行的结果Public class BasePublic virtual string Hello() {return “Base”;}Public class Sub:BasePublic override string Hello() {return “Sub”;}1. Base b = new Base(); b.Hello;2. Sub s = new Sub(); s.Hello;3. Base b = new Sub (); b.Hello;4. Sub s = new Base(); s.Hello;

下列代码段的执行结果是( )。 public class Test { public static void main(String args[ ]) { String s1= new String("hello"); String s2= new String("hello"); System.out.println(s1==s2); System.out.println(s1.equal(s2)); } }A.true falseB.true trueC.false trueD.false false

下列代码的执行结果是______。 public class ex55 { public static void main(String args[] ) { String s1=new String("hello"); String s2=new String("hello"); System.out.print (s1==s2); System.out.print (","); System.out.println (s1.equals (s2)); } }A.true, falseB.true, trueC.false, trueD.false, false

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

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

设有如下变量char c = 'c';int i = 10;double d = 10;long l = 1;String s = "Hello";以下哪些语句编译不出错? A.c=c+i;B. s+=i;C. i+=s;D. c+=s;

下列选项中,()是正确的表达式。 A、% String s = “hello world ” ;%  B、% = “hello world ” ;% C、% = “hello world ” %  D、% ! “hello world ” %

设String对象s="H",运行语句System.out.println(s.concat("ello!"));后String对象s的内容为"Hello!",所以语句输出为"Hello!"。

顺序执行下列程序语句后,则b的值是() String str = "Hello"; String b = str.substring(0,2);A、HelloB、helloC、HeD、null

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;

public class X {   public static void main (String[]args)   {   string s = new string (“Hello”);   modify(s);   System.out.printIn(s);   }   public static void modify (String s)  {   s += “world!”;      }   }      What is the result?()    A、 The program runs and prints “Hello”B、 An error causes compilation to fail.C、 The program runs and prints “Hello world!”D、 The program runs but aborts with an exception.

public class X {   public static void main (Stringargs) {   string s = new string (“Hello”);   modify(s);   System.out.printIn(s);   }   public static void modify (String s) {   s += “world!”;   }   }   What is the result?() A、The program runs and prints “Hello”B、An error causes compilation to fail.C、The program runs and prints “Hello world!”D、The program runs but aborts with an exception.

单选题有语句String s=”hello world”; ,以下操作哪个是不合法的()Aint i=s.length();Bs=3;CString ts=s.trim();DString t=s+”!”

多选题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;

单选题public class X {   public static void main (Stringargs) {   string s = new string (“Hello”);   modify(s);   System.out.printIn(s);   }   public static void modify (String s) {   s += “world!”;   }   }   What is the result?()AThe program runs and prints “Hello”BAn error causes compilation to fail.CThe program runs and prints “Hello world!”DThe program runs but aborts with an exception.

判断题设String对象s="H",运行语句System.out.println(s.concat("ello!"));后String对象s的内容为"Hello!",所以语句输出为"Hello!"。A对B错

单选题public class X {   public static void main (String[]args)   {   string s = new string (“Hello”);   modify(s);   System.out.printIn(s);   }   public static void modify (String s)  {   s += “world!”;      }   }      What is the result?()A The program runs and prints “Hello”B An error causes compilation to fail.C The program runs and prints “Hello world!”D The program runs but aborts with an exception.

单选题下列选项中,()是正确的表达式。A% String s = “hello world ” ;%  B% = “hello world ” ;% C% = “hello world ” %  D% ! “hello world ” %