单选题设有定义:String s=“World”;,下列语句错误的是()。Aint m=s.indexOf(‘r’);Bchar c=s.charAt(0);Cint n=s.length();DString str=s.append(‘2’);

单选题
设有定义:String s=“World”;,下列语句错误的是()。
A

int m=s.indexOf(‘r’);

B

char c=s.charAt(0);

C

int n=s.length();

D

String str=s.append(‘2’);


参考解析

解析: 暂无解析

相关考题:

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

阅读下列代码 public class Test{ String s="One World One Dream"; public static void main(String args[]){ System. out. println(s); } } 其运行结果是A.argsB.One World One DreamC.sD.编译时出错

设有语句组:Dim S1 As String*5S1 = "VB Test"则S1的值为( )。A、 VB TestB、 VB TeC、 VBTesD、 BTest

下列语句输出结果为( )。 public class test\ { public static void main (String args[]) { String s1=new String("How"); String s2=new String("How"); System.out.println(!(s1.equals(s2))); } }A.falseB.trueC.0D.1

为了从HTML文件中获取参数,在Applet程序中应该编写的代码是 ( )A.在start()方法中加入语句String s=getParameter("buttonLabel");B.在init()方法中加入语句String s=Parameter("buttonLabel");C.在init()方法中加入语句String s=getParameter("BUTTONLABEL");D.在start()方法中加入语句String s=getParameter("BUTTONLABEL");

关于下面语句的说法正确的是 String[]s=new String[10][];A.该语句不合法B.该语句定义了一个二维数组,它包括10行10列C.s是一个包含10个数组的数组D.s中的每一个元素都被设置成""

下列语句能给数组赋值而不使用for循环的是A.myArray{[1]="One";[2]="Two";[3]="Three";}B.String s[5]=new String[]{"Zero", "One", "Two", "There", "Four"};C.String s[]=new String[]{"Zero", "One", "Two", "There", "Four"};D.String s[]=new String[]=|"Zero", "One", "Two", "There", "Four"};

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

设有定义:Strings=“World”;,下列语句错误的是( )。A、intm=s.indexOf(‘r’);B、charc=s.charAt(0);C、intn=s.length();D、Stringstr=s.append(‘2’);

设有定义:"char s[12]={"string"};" 则printf("%d\n",strlen(s));的输出是( )A.6B.7C.11D.12

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

在Java语言中,下列语句能通过编译的是()。 A、String s = "john" + " was " + " here";B、String s = "john" + 3;C、int a = 3 + 5;D、int a = 5 + 5.5;

设有定义:String s=“World”;,下列语句错误的是()。A、int m=s.indexOf(‘r’);B、char c=s.charAt(0);C、int n=s.length();D、String str=s.append(‘2’);

有声明语句:delegate void TimeDelegate(string s),则以下语句可以和委托TimeDelegate绑定的方法是()A、 void f(){  }B、 string f(){  }C、 void f(string a){  }D、 string f(string a){  }

设有定义:chars[12]=“string“;,则printf(“%d/n”,strlen(s));的输出是()。A、6B、7C、11D、12

语句Dim s(1 to 5)as String定义的数组是()类型的元素。A、整型B、日期型C、逻辑型D、字符型

设有语句组: Dim S1 As String*5 S1="VB Test" 则S1的值为()。A、VB TestB、VB TeC、VB TesD、BTest

有语句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.

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

单选题语句Dim s(1 to 5)as String定义的数组是()类型的元素。A整型B日期型C逻辑型D字符型

单选题以下是子过程或函数过程定义中的开始语句,错误的为()。APrivate Function f( x As String ) As SingleBPrivate Function f( x As String )CPrivate Sub f( x As String ) As SingleDPrivate Sub f( x As String )

单选题在VB语言中,下列定义变量语句格式正确的是()。ADim As String xuehaoBDim xuehao As StringCDim String As xuehaoDConst xuehao As String

单选题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 ” %