请问每年教授的funding什么时候出结果# Engineering - 工程
r*l
1 楼
1, 下面的code运行结果会怎么样? Assume you don't have java in handy to test
run it.
2, 如果面试被问到,怎么回答呢?
try {
char[] cs = {'a', 'b'};
String s = null;
s = s.copyValueOf(cs);
System.out.print(s);
} catch (NullPointerException e) {
System.exit(1);
} catch (Throwable e) {
System.exit(2);
}
Note: "copyValueOf" is a static method of String class.
1, prints out "ab"
2, exit with "1"
3, exit with "2"
run it.
2, 如果面试被问到,怎么回答呢?
try {
char[] cs = {'a', 'b'};
String s = null;
s = s.copyValueOf(cs);
System.out.print(s);
} catch (NullPointerException e) {
System.exit(1);
} catch (Throwable e) {
System.exit(2);
}
Note: "copyValueOf" is a static method of String class.
1, prints out "ab"
2, exit with "1"
3, exit with "2"