网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
多选题
已知Strings=“Java”,则下面哪些代码是正确的()
A
s=s+1;
B
char c=s[3];
C
int i=s.length;
D
String t=s+new Object();
参考答案
参考解析
解析:
暂无解析
更多 “多选题已知Strings=“Java”,则下面哪些代码是正确的()As=s+1;Bchar c=s[3];Cint i=s.length;DString t=s+new Object();” 相关考题
考题
下面哪段语法执行正确()
A.Strings=Gonewiththewind;Stringt=good;Stringk=s+t;B.Strings=Gonewiththewind;Stringt;t=s[3]+one;C.Strings=Gonewiththewind;Stringstandard=s.toUpperCase();D.Strings=homedirectory;Stringt=s-directory;
考题
publicclassEqTest{()Publicstaticvoidmain(Stringargs[])EqTeste=newEqTest();}EqTest(){Strings=”Java”;Strings2=”java”;//在这儿放置测试代码{Systrm.out.println(相等”);Else{System.out.println(不相等”)}}}在上面的java代码的注释行位置,放置()测试代码能输出相等”结果A.if(s==s2)B.if(s.equals(s2))C.if(s.equalsIgnoreCase(s2))D.if(s.noCaseMatch(s2))
考题
下面的哪些程序片段可能导致错误()。
A.Strings=“Gonewiththewind”;Stringt=“good”;Stringk=s+t;B.Strings=“Gonewiththewind”;Stringt;t=s[3]+“one”;C.Strings=“Gonewiththewind”;Stringstandard=s.toUpperCase();D.Strings=“homedirectory”;Stringt=s–“directory”;
考题
已知如下定义: String s = "story"; 下面哪些表达式是合法的?()
A.s += "books";B.char c = s[1];C.int len = s.length;D.String t = s.toLowerCase();
考题
String s=”Example String”; 下面哪些语句是正确的?()
A.s>>>=3;B.int i=s.length();C.s[3]=”x”;D.String short_s=s.trim();E.String t=”root”+s;
考题
已知程序段: S=0 FOR I = 1 T() 10 STEP 2 S=S+1 I=I.2 NEXT I当循环结束后,变量I和s的值分别为( )。A.10和2B.11和5C.16和4D.22和3
考题
已知有定义:Strings="story",下面()表达式是合法的。A.s+="books";B.charC=s[1];C.intlen=s.length;D.Strings=s.toLowerCase();
考题
给定如下所示的JAVA代码,则运行时,会产生( )类型的异常Strings=null;s.concat("abcs.concat("abc");A.ArithmeticExceptionB.NullPointerExceptionC.IOExceptionD.ClassNotFoundException
考题
下面这段代码会产生( )个String对象。Strings1="hello";Strings2=s1.substring(2,3);Strings3=s1.toString();Strings4=newStringBuffer(s1).toString();A、1B、2C、3D、4
考题
设有定义:Strings=“World”;,下列语句错误的是( )。A、intm=s.indexOf(‘r’);B、charc=s.charAt(0);C、intn=s.length();D、Stringstr=s.append(‘2’);
考题
执行代码Strings=newString("Hello")后,正确的结论是()A、s最后一个索引值为5B、s的值和"Hello"并不一样C、s.length为4D、s.length为5
考题
设Strings="story";下列选项中的语句书写正确的是()。A、s+="books";B、char c = s[1];C、int len = s.length;D、s = s-"books";
考题
有语句String s=”hello world”; ,以下操作哪个是不合法的()A、int i=s.length();B、s=3;C、String ts=s.trim();D、String t=s+”!”
考题
已知Strings=“Java”,则下面哪些代码是正确的()A、s=s+1;B、char c=s[3];C、int i=s.length;D、String t=s+new Object();
考题
1. import java.util.*; 2. public class Test { 3. public static void main(String[] args) { 4. List strings = new ArrayList(); 5. // insert code here 6. } 7. } Which four, inserted at line 5, will allow compilation to succeed?()A、 String s = strings.get(0);B、 Iterator i1 = strings.iterator();C、 String[] array1 = strings.toArray();D、 Iterator i2 = strings.iterator();E、 String[] array2 = strings.toArray(new String[1]);F、 Iterator i3 = strings.iterator();
考题
多选题1. import java.util.*; 2. public class Test { 3. public static void main(String[] args) { 4. List strings = new ArrayList(); 5. // insert code here 6. } 7. } Which four, inserted at line 5, will allow compilation to succeed?()AString s = strings.get(0);BIterator i1 = strings.iterator();CString[] array1 = strings.toArray();DIterator i2 = strings.iterator();EString[] array2 = strings.toArray(new String[1]);FIterator i3 = strings.iterator();
考题
单选题有语句String s=”hello world”; ,以下操作哪个是不合法的()A
int i=s.length();B
s=3;C
String ts=s.trim();D
String t=s+”!”
考题
多选题下面的哪些程序片段可能导致错误()。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”;
考题
多选题已知如下定义:Strings="story";下面哪个表达式是合法的()As+=booksBcharc=s[1]Cintlen=s.lengthDStringt=s.toLowerCase()
考题
多选题下面哪段语法执行正确()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;
考题
单选题设有定义: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’);
考题
单选题有语句Strings=”helloworld”;,以下操作哪个是不合法的?()A
inti=s.length()B
s=3C
Stringts=s.trim()D
Stringt=s+”!”
考题
多选题已知Strings=“Java”,则下面哪些代码是正确的()As=s+1;Bchar c=s[3];Cint i=s.length;DString t=s+new Object();
考题
多选题在Java语言中,下列语句能通过编译的是()。AString s = john + was + here;BString s = john + 3;Cint a = 3 + 5;Dint a = 5 + 5.5;
考题
多选题Given that c is a reference to a valid java.io.Console object,which two code fragments read a line of textfrom the console?()AString s = c.readLine();Bchar[] c = c.readLine();CString s = c.readConsole();Dchar[] c = c.readConsole();EString s = c.readLine(%s, name );
考题
单选题设Strings="story";下列选项中的语句书写正确的是()。A
s+=books;B
char c = s[1];C
int len = s.length;D
s = s-books;
热门标签
最新试卷