String regex="";
String regex=" .";
String regex=".*";
String regex="//s";
String regex="//.//s*";
String regex="//w[/.]+";
第1题:
说出下面几个函数的区别:
private void test(string str){…}
private void test(ref string str){…}
private void test(out string str){…}
如果一个页面与数据
第2题:
public class Test { public static void main (Stringargs) { String foo = args[1]; String bar = args; String baz = args; System.out.printIn(“baz = ” + baz); } } And the output: Baz = 2 Which command line invocation will produce the output?()
第3题:
Given: 11. String test = "This is a test"; 12. String[] tokens = test.split("/s"); 13. System.out.println(tokens.length); What is the result?()
第4题:
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?()
第5题:
Consider the following class: class Test(int i) { void test(int i) { System.out.println(“I am an int.”); } void test(String s) { System.out.println(“I am a string.”); } public static void main(String args) { Test t=new Test(); char ch=“y”; t.test(ch); } } Which of the statements below is true?()
第6题:
Given: 11.String test = "This is a test"; 12.String[] tokens = test.split("/s"); 13.System.out.println(tokens.length); What is the result?()
第7题:
You define the following regular expression of currency values: regex tx = new regex("^-?/d+(/./d{2})?$") You are required to write code that will be used to find whether a string in the variable named Bill matches the regular expression or not. You are also required to use this code as the expression in a conditional statement and need to know which code segment to use. What should you do?()
第8题:
An exception is thrown at runtime.
1
4
Compilation fails.
0
第9题:
0
1
4
Compilation fails.
第10题:
String regex = ;
String regex = ;
String regex = .*;
String regex = //s;
String regex = //.//s*;
第11题:
a b c
1 2 3
a1b2c3
a1 b2 c3
第12题:
String regex="";
String regex=" .";
String regex=".*";
String regex="//s";
String regex="//.//s*";
String regex="//w[/.]+";
第13题:
You define the following regular expression of currency values:regex tx = new regex("^-?\d+(\.\d{2})?$")You are required to write code that will be used to find whether a string in the variable named Bill matches the regular expression or not. You are also required to use this code as the expression in a conditional statement and need to know which code segment to use.What should you do?()
A.The tx.Matches(Bill)
B.The tx.Equals(Bill)
C.The tx.Match(Bill)
D.The tx.IsMatch(Bill)
第14题:
int index = 1; String test = new String; String foo = test[index]; What is the result?()
第15题:
Given: 11.String test = "a1b2c3"; 12.String[] tokens = test.split("//d"); 13.for(String s: tokens) System.out.print(s + " "); What is the result?()
第16题:
11. String test = “This is a test”; 12. String[] tokens = test.split(”/s”); 13. System.out.println(tokens.length); What is the result?()
第17题:
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”?()
第18题:
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"?()
第19题:
String regex = “”;
String regex = “ “;
String regex = “.*“.
String regex = “//s”
String regex = “//.//s*”;
String regex = “//w[ /.] +“;
第20题:
Java Test 2222
Java Test 1 2 3 4
Java Test 4 2 4 2
Java Test 4 3 2 1
第21题:
Java Test 2222
Java Test 1 2 3 4
Java Test 4 2 4 2
Java Test 4 3 2 1
第22题:
0
1
4
Compilation fails.
An exception is thrown at runtime.
第23题:
Line 5 will not compile, because void methods cannot be overridden.
Line 12 will not compile, because there is no version of test() that rakes a charargument.
The code will compile but will throw an exception at line 12.
The code will compile and produce the following output: I am an int.
The code will compile and produce the following output: I am a String.
第24题:
The tx.Matches(Bill)
The tx.Equals(Bill)
The tx.Match(Bill)
The tx.IsMatch(Bill)