0
1
4
Compilation fails.
An exception is thrown at runtime.
第1题:
A.Anexceptionisthrownatruntime.
B.1
C.4
D.Compilationfails.
E.0
第2题:
说出下面几个函数的区别:
private void test(string str){…}
private void test(ref string str){…}
private void test(out string str){…}
如果一个页面与数据
第3题:
A.0
B.1
C.4
D.Compilationfails.
E.Anexceptionisthrownatruntime.
第4题:
int index = 1; String test = new String; String foo = test[index]; What is the result?()
第5题:
执行以下代码会输出什么结果?() public class Test { StringgetStr(String s){ return s + “hello”; } public static void main(String arg[]) { Test t= new Test(); System.out.println(t.getStr(“LiLei/n”)); } }
第6题:
A.0
B.1
C.4
D.Compilationfails.
第7题:
考虑如下类:
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.
第8题:
A.String regex="";
B.String regex=" .";
C.String regex=".*";
D.String regex="\\s";
E.String regex="\\.\\s*";
F.String regex="\\w[\.]+";
第9题:
11. String test= “a1b2c3”; 12. String[] tokens = test.split(”//d”); 13. for(String s: tokens) System.out.print(s +“ “); What is the result?()
第10题:
Given: 11. String test = "This is a test"; 12. String[] tokens = test.split("/s"); 13. System.out.println(tokens.length); What is the result?()