TA的每日心情 | 开心 2021-3-12 23:18 |
---|
签到天数: 2 天 [LV.1]初来乍到
|
Swing 介绍。PPT格式,北大青鸟。
考考你(20):
What does the following program do when it is run
with the following command?java Mystery Mighty Mouse
1. class Mystery {
2. public static void main(String args[]){
3. Changer c = new Changer();
4. c.method(args);
5. System.out.println(args[0] + " " + args[1]);
6. }
7. static class Changer {
8. void method(String s[]) {
9. String temp = s[0];
10. s[0] = s[1];
11. s[1] = temp;
12. }
13. }
14. }
a. The program causes and ArrayIndexOutOfBoundsException to be thrown.
b. The program runs but does not write anything to the standard output.
c. The program writes "Mighty Mouse" to the standard output.
d. The program writes "Mouse Mighty" to the standard output. 点击查看答案
源码下载:http://file.javaxxz.com/2014/10/28/235518406.zip |
|