网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
单选题
设有定义: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=“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"));
考题
阅读下列代码 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.编译时出错
考题
下列语句输出结果为( )。 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"};
考题
设有定义:Strings=“World”;,下列语句错误的是( )。A、intm=s.indexOf(‘r’);B、charc=s.charAt(0);C、intn=s.length();D、Stringstr=s.append(‘2’);
考题
下列选项中,()是正确的表达式。 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){ }
考题
有语句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”; ,以下操作哪个是不合法的()A
int i=s.length();B
s=3;C
String ts=s.trim();D
String t=s+”!”
考题
单选题以下是子过程或函数过程定义中的开始语句,错误的为()。A
Private Function f( x As String ) As SingleB
Private Function f( x As String )C
Private Sub f( x As String ) As SingleD
Private Sub f( x As String )
考题
单选题在VB语言中,下列定义变量语句格式正确的是()。A
Dim As String xuehaoB
Dim xuehao As StringC
Dim String As xuehaoD
Const 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 ” %
热门标签
最新试卷