下面代码的运行结果是_____________。 public class Test{ public static void main(String[] args){ int[] a=new int[3]; int[] b= new int[]{1,2,3,4,5}; a=b; for(int i=0; i
举一反三
- 下面代码的运行结果是。 public class Test { public static void main(System[] args){ int[ ] a ={10,20,30}; int[ ] b ={1,2,3,4,5}; a=b; for (int i=0;i<a.length;i++){ System.out.print(a[i]+” ”); } } }[/i]
- 以下程序的输出结果是【 】。 class Program { public static void Main(string[] args) { int[] a = new int[3] { 1, 2, 3 }; for (int i = 0; i < 3; i++) Console.Write("{0} ", a[i]); Console.WriteLine(); int[] b = a; for (int i = 0; i < 3; i++) b[i] = 2 * b[i]; for (int i = 0; i < 3; i++) Console.Write("{0} ", a[i]); Console.WriteLine(); Console.Read(); } }[/i][/i][/i][/i]
- 下面代码的运行结果是( )。public class Test {public static void main(System[] args){int[ ] a ={10,20,30};int[ ] b ={1,2,3,4,5};a=b;for (int i=0;i<a.length;i++){System.out.print(a[i]+” ”);}}}[/i] A: 程序报错 B: 10 20 30 C: 1 2 3 4 5 D: 1 2 3
- 中国大学MOOC: class C { public static void main(String[] args) { int[] array = new int[10]; increase(array); System.out.print(array[0]); } public static void increase(int[] array) { for(int i = 0; i < array.length; i++) { array[i]++; } }}则输出为[/i]
- 中国大学MOOC: 已知:class C { public static void main(String[] args) { int[] array = new int[10]; increase(array); System.out.print(array[0]); } public static void increase(int[] array) { for(int i = 0; i < array.length; i++) { array[i]++; } }}则输出为[/i]