public class TestArr { public static void main(String[] args) { int[] nums = {12,35,36,56}; //遍历数组:数组下班从零开始 用 数组名[下标] 访问元素如:nums[0] for (int i = 0; i < nums.length; i++) { System.out.println(nums[i]); } }}