题海让大学四年没有难题
白天模式登陆

题目详情

单选题 读程,判断程序的输出是什么? class LowHighSwap { static void doIt( int[] z ) { int temp = z[z.length-1]; z[z.length-1] = z[0]; z[0] = temp; } } class TestIt { public static void main( String[] args ) { int[] myArray = {1, 2, 3, 4, 5}; LowHighSwap.doIt(myArray); for (int i = 0; i < myArray.length; i++) { System.out.print(myArray[i] + " "); } } }

A. 5 2 3 4 5

B. 1 2 3 4 1

C. 5 2 3 4 1

D. 1 2 3 4 5

Java编程及应用课程封面

学科:Java编程及应用

时间:2023-11-08 15:11:49

Copyright © 2022 津ICP备2021001502号