| 
 
| 问题1: 下面代码的输出结果是什么
 int[] arr = new int[20];
 System.out.println(arr[1]);
 正确答案:0,为什么不是null?
 
 问题2:
 下面哪个语句正确地声明一个整型的二维数组
 A. int arr1[][] = new int[][];
 B.int arr2[10][10] = new int[][];
 C.int []products[] = new int[30][];
 D.int names[][] = new int[][10];
 答案:C,我知道ABC都是错的,二维数组可以这样声明吗?
 
 问题3:
 下面代码的输出结果是什么?
 String s1 = new String("hello");
 s1 = s1.replace('e','x');
 String s3 = "hxllr";
 String s4 = "hxllr";
 String s2 = s1.replace('o','r');
 System.out.println(s2);
 System.out.println(s2 == s3);
 System.out.println(s3 == s4);
 A.hxllr       B.hxllr       C.hxllr        D.以上全不对
 false         true           true
 true          true           false
 答案:A,这题似懂非懂,地址?引用?
 
 问题4:
 下面哪些赋值语句是正确的?(多选)
 A.int test = 012;
 B.float f = -412;
 C.int other = (int) true;
 D.double d = 0x12345678;
 答案:A、B、D,通一套题,前面有一个单选,C却是对的?答案错了?
 
 问题5:
 String类型的值传递是什么传递?
 
 谢谢各位亲朋好友了(づ ̄ 3 ̄)づ
 | 
 |