a b c
1 2 3
a1b2c3
a1 b2 c3
Compilation fails.
The code runs with no output.
An exception is thrown at runtime.
第1题:
A.0
B.1
C.4
D.Compilationfails.
E.Anexceptionisthrownatruntime.
第2题:
A.Anexceptionisthrownatruntime.
B.1
C.4
D.Compilationfails.
E.0
第3题:
A.Stringregex=“”;
B.Stringregex=““;
C.Stringregex=“.*“.
D.Stringregex=“\\s”
E.Stringregex=“\\.\\s*”;
F.Stringregex=“\\w[\.]+“;
第4题:
考虑如下类:
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.
第5题:
A.abc
B.123
C.a1b2c3
D.a1b2c3
第6题:
A.String regex="";
B.String regex=" .";
C.String regex=".*";
D.String regex="\\s";
E.String regex="\\.\\s*";
F.String regex="\\w[\.]+";
第7题:
A.0
B.1
C.4
D.Compilationfails.
第8题:
A.abc
B.123
C.a1b2c3
D.a1b2c3
E.Compilationfails.
F.Thecoderunswithnooutput.
G.Anexceptionisthrownatruntime.
第9题:
说出下面几个函数的区别:
private void test(string str){…}
private void test(ref string str){…}
private void test(out string str){…}
如果一个页面与数据
第10题:
11. String test= “a1b2c3”; 12. String[] tokens = test.split(”//d”); 13. for(String s: tokens) System.out.print(s +“ “); What is the result?()