单选题11. String test= “a1b2c3”; 12. String[] tokens = test.split(”//d”); 13. for(String s: tokens) System.out.print(s +“ “); What is the result?()A a b cB 1 2 3C a1b2c3D a1 b2 c3E Compilation fails.F The code runs with no output.G An exception is thrown at runtime.
单选题
11. String test= “a1b2c3”; 12. String[] tokens = test.split(”//d”); 13. for(String s: tokens) System.out.print(s +“ “); What is the result?()
A
a b c
B
1 2 3
C
a1b2c3
D
a1 b2 c3
E
Compilation fails.
F
The code runs with no output.
G
An exception is thrown at runtime.
参考解析
解析:
暂无解析
相关考题:
Stringtest=TestA.TestB.TestC.”;12.//insertcodehere13.String[]result=test.split(regex);Whichregularexpressioninsertedatline12willcorrectlysplittestintoTestA,”TestB,”andTestC”?() A.Stringregex=“”;B.Stringregex=““;C.Stringregex=“.*“.D.Stringregex=“\\s”E.Stringregex=“\\.\\s*”;F.Stringregex=“\\w[\.]+“;
Stringtest=a1b2c3”;12.String[]tokens=test.split(”\\d”);13.for(Strings:tokens)System.out.print(s+);Whatistheresult?() A.abcB.123C.a1b2c3D.a1b2c3E.Compilationfails.F.Thecoderunswithnooutput.G.Anexceptionisthrownatruntime.
Stringtest=Thisisatest”;12.String[]tokens=test.split(”\s”);13.System.out.println(tokens.length);Whatistheresult?() A.0B.1C.4D.Compilationfails.E.Anexceptionisthrownatruntime.
Given:Which regular expression, inserted at line 12, correctly splits test into Test A, Test B, and Test C?() A.String regex=;B.String regex= .;C.String regex=.*;D.String regex=\\s;E.String regex=\\.\\s*;F.String regex=\\w[\.]+;
Given:11.Stringtest=Thisisatest;12.String[]tokens=test.split(\s);13.System.out.println(tokens.length);Whatistheresult?() A.Anexceptionisthrownatruntime.B.1C.4D.Compilationfails.E.0
Given:11.Stringtest=Thisisatest;12.String[]tokens=test.split(\s);13.System.out.println(tokens.length);Whatistheresult?() A.0B.1C.4D.Compilationfails.
Given:11.Stringtest=a1b2c3;12.String[]tokens=test.split(\\d);13.for(Strings:tokens)System.out.print(s+);Whatistheresult?() A.abcB.123C.a1b2c3D.a1b2c3
说出下面几个函数的区别:private void test(string str){…}private void test(ref string str){…}private void test(out string str){…}如果一个页面与数据
考虑如下类:1. class Test(int i) {2. void test(int i) {3. System.out.println("I am an int.");4. }5. void test(String s) {6. System.out.println("I am a string.");7. }8.9. public static void main(String args[]) {10. Test t=new Test();11. char ch="y";12. t.test(ch);13. }14. }以下哪条为真?A.行 5 不能通过编译,方法不能被覆盖.B.行 12 不能通过编译, 因为没有一个test()方法含字符参数.C.代码可以编译但在12行将出现异常.D.代码可以编译且产生如下输出: I am an int.E.代码可以编译且产生如下输出: I am a String.
11. String test= “a1b2c3”; 12. String[] tokens = test.split(”//d”); 13. for(String s: tokens) System.out.print(s +“ “); What is the result?() A、 a b cB、 1 2 3C、 a1b2c3D、 a1 b2 c3E、 Compilation fails.F、 The code runs with no output.G、 An exception is thrown at runtime.
int index = 1; String test = new String; String foo = test[index]; What is the result?()A、 Foo has the value “”B、 Foo has the value nullC、 An exception is thrownD、 The code will not compile
Given: 11. String test = "This is a test"; 12. String[] tokens = test.split("/s"); 13. System.out.println(tokens.length); What is the result?()A、 An exception is thrown at runtime.B、 1C、 4D、 Compilation fails.E、 0
Given: 11.String test = "a1b2c3"; 12.String[] tokens = test.split("//d"); 13.for(String s: tokens) System.out.print(s + " "); What is the result?()A、a b cB、1 2 3C、a1b2c3D、a1 b2 c3
public class Test { public static void main (String[]args) { String foo = args[1]; String bar = args[2]; String baz = args[3]; System.out.printIn(“baz = ” + baz); } } And the output: Baz = 2 Which command line invocation will produce the output?() A、 Java Test 2222B、 Java Test 1 2 3 4C、 Java Test 4 2 4 2D、 Java Test 4 3 2 1
int index = 1; String [] test = new String[3]; String foo = test[index]; What is the result?() A、 Foo has the value “”B、 Foo has the value nullC、 An exception is thrownD、 The code will not compile
11. String test = “Test A. Test B. Test C.”; 12. // insert code here 13. String[] result = test.split(regex); Which regular expression inserted at line 12 will correctly split test into “Test A,” “Test B,” and “Test C”?()A、 String regex = “”;B、 String regex = “ “;C、 String regex = “.*“.D、 String regex = “//s”E、 String regex = “//.//s*”;F、 String regex = “//w[ /.] +“;
Given: 11.String test = "Test A. Test B. Test C."; 12.// insert code here 13.String[] result = test.split(regex); Which regular expression, inserted at line 12,correctly splits test into "Test A","Test B",and "Test C"?()A、String regex = "";B、String regex = " ";C、String regex = ".*";D、String regex = "//s";E、String regex = "//.//s*";
单选题Given: 11.String test = "Test A. Test B. Test C."; 12.// insert code here 13.String[] result = test.split(regex); Which regular expression, inserted at line 12,correctly splits test into "Test A","Test B",and "Test C"?()AString regex = ;BString regex = ;CString regex = .*;DString regex = //s;EString regex = //.//s*;
单选题Given: 11.String test = "a1b2c3"; 12.String[] tokens = test.split("//d"); 13.for(String s: tokens) System.out.print(s + " "); What is the result?()Aa b cB1 2 3Ca1b2c3Da1 b2 c3
单选题1. class A { 3. public String to String() { 4. return “4”; 5. } 6. } 7. class B extends A { 8. public String toString() { 9. return super.toString() + “3”; 10. } 11. } 12. public class Test { 13. public static void main (String[] args) { 14. System.out.printIn(new B()); 15. } 16. } What is the result( )?A Compilation succeeds and 4 is printed.B Compilation …………… is printed.C An error on line 9 cause compilation to fail.D An error on line 14 cause compilation to fail.E Compilation succeeds but an exception is thrown at line 9.
单选题11. public static void test(String str) { 12. if(str == null | str.lellgth() == 0) { 13. System.out.println(”String is empty”); 14. } else { 15. System.out.println(”String is not empty”); 16. } 17. } And the invocation: 31. test(llull); What is the result?()A Au exception is thrown at runtime.B “String is empty” is printed to output.C Compilation fails because of au error in line 12.D “String is not empty” is printed to output.
单选题Given: 11.String test = "This is a test"; 12.String[] tokens = test.split("/s"); 13.System.out.println(tokens.length); What is the result?()A0B1C4DCompilation fails.
单选题int index = 1; String test = new String; String foo = test[index]; What is the result?()A Foo has the value “”B Foo has the value nullC An exception is thrownD The code will not compile
单选题int index = 1; String [] test = new String[3]; String foo = test[index]; What is the result?()A Foo has the value “”B Foo has the value nullC An exception is thrownD The code will not compile
单选题Given: 11. String test = "This is a test"; 12. String[] tokens = test.split("/s"); 13. System.out.println(tokens.length); What is the result?()A An exception is thrown at runtime.B 1C 4D Compilation fails.E 0
单选题11. String test = “Test A. Test B. Test C.”; 12. // insert code here 13. String[] result = test.split(regex); Which regular expression inserted at line 12 will correctly split test into “Test A,” “Test B,” and “Test C”?()A String regex = “”;B String regex = “ “;C String regex = “.*“.D String regex = “//s”E String regex = “//.//s*”;F String regex = “//w[ /.] +“;
单选题Given: Which regular expression, inserted at line 12, correctly splits test into "Test A", "Test B", and "Test C"?()A String regex="";B String regex=" .";C String regex=".*";D String regex="//s";E String regex="//.//s*";F String regex="//w[/.]+";