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

单选题
有语句String s=”hello world”; ,以下操作哪个是不合法的()
A

int i=s.length();

B

s>>>=3;

C

String ts=s.trim();

D

String t=s+”!”


参考解析

解析: 暂无解析

相关考题:

下面两个语句是等价的:ChArstr[]='hEllo,worlD';ChArstr[11]='hEllo,worlD';()

下列程序段的输出结果是( )。 String MyStr="Hello,"; MyStr=MyStr+ "World!"; System.out.println(MyStr);A.Hello, World!B.Hello,C.World!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"));

publicclassX{publicstaticvoidmain(String[]args){strings=newstring(Hello”);modify(s);System.out.printIn(s);}publicstaticvoidmodify(Strings){s+=world!”;}}Whatistheresult?() A.Theprogramrunsandprints“Hello”B.Anerrorcausescompilationtofail.C.Theprogramrunsandprints“Helloworld!”D.Theprogramrunsbutabortswithanexception.

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

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

下列程序段的输出结果是 String MyStr = "Hello,"; MyStr = MyStr + "World!"; System.out.println(MyStr);A.Hello,World!B.Hello,C.World!D.该程序段有语法错误

在C++语言中输出“Hello World”的语句是()。A.cout>"Hello World";C.cin 在C++语言中输出“Hello World”的语句是( )。A.cout<<"Hello World";B.cout>>"Hello World";C.cin<<"Hello World";D.cin>>"Hello World";

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

向页面输出Hello World的JavaScript语句是( )。 A.printf(Hello WorldHello World的JavaScript语句是( )。A.printf(Hello World) B.document.write(Hello World)C.h4Hello World/h4 D.alert(Hello World)

向页面输出“Hello World”的JavaScript语句是()。A.printf("Hello World")B.document.write("Hello World")C.Hello WorldD.alert("Hello World")

下列选项中,()是正确的表达式。 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!"。

欲为字符串S1输入”Hello World!”,其语句是()。

语句PrintFormat(“Hello World”,“”)的输出结果是()。A、hello WORLDB、hello worldC、HELLO WORLDD、HELLO world

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

java中 String str = "hello world"下列语句错误的是()。A、str+=’ a’B、int strlen = str.lengthC、str=100D、str=str+100

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.

单选题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.

单选题有语句Strings=”helloworld”;,以下操作哪个是不合法的?()Ainti=s.length()Bs=3CStringts=s.trim()DStringt=s+”!”

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