JAVA开发工程师笔试题(二十二)

时长:60分钟 总分:100分

288浏览 1人已完成答题

题型介绍
题型 单选题
数量 2
JAVA开发工程师笔试题(二十二)
1.
public class TestPass { String str = new String("hello"); char[] ch = {'a','b','c'}; public static void main(String[] args) { TestPass ex = new TestPass( ); ex.change(ex.str,ex.ch); System.out.print(ex.str + " and "); System.out.print(ex.ch); } private void change(String str,char[] ch) { str = "test ok"; ch[1] = 'g'; } } 程序运行结果?
问题详情




2.
以下代码的执行结果是? public class Example { public static void main(String[] args) { Element[] a1 = new Element[1]; Element[][] a2 = new Element[2][1]; Element[][][] a3 = new Element[3][3][3]; System.out.print(a3[2][2][2]); a1[0] = new Element( ); a2[0] = a2[1] = a1; a3[0] = a3[1] = a3[2] = a2; System.out.print(a3[2][2][2]); } } class Element { }
问题详情