标签:sys string pre src stat alt 数组 int public
1 public class DemoArray { 2 public static void main(String[] args) { 3 4 int[] array = new int[3]; 5 System.out.println(array); 6 System.out.println(array[0]); 7 System.out.println(array[1]); 8 System.out.println(array[2]); 9 System.out.println("=========================="); 11 array[1] = 10; 12 array[2] = 20; 13 System.out.println(array); 14 System.out.println(array[0]); 15 System.out.println(array[1]); 16 System.out.println(array[2]); 18 } 19 }
1 package cn.itcast.day_04.demo_03; 2 3 public class DemoArray { 4 public static void main(String[] args) { 5 6 int[] arrayA = new int[3]; 7 System.out.println(arrayA); 8 System.out.println(arrayA[0]); 9 System.out.println(arrayA[1]); 10 System.out.println(arrayA[2]); 11 System.out.println("=========================="); 12 13 arrayA[1] = 10; 14 arrayA[2] = 20; 15 System.out.println(arrayA); 16 System.out.println(arrayA[0]); 17 System.out.println(arrayA[1]); 18 System.out.println(arrayA[2]); 19 System.out.println("=========================="); 20 21 int[] arrayB = arrayA; 22 System.out.println(arrayB); 23 System.out.println(arrayB[0]); 24 System.out.println(arrayB[1]); 25 System.out.println(arrayB[2]); 26 System.out.println("=========================="); 27 28 arrayB[1] = 100; 29 arrayB[2] = 200; 30 System.out.println(arrayB); 31 System.out.println(arrayB[0]); 32 System.out.println(arrayB[1]); 33 System.out.println(arrayB[2]); 34 System.out.println("=========================="); 35 } 36 }
标签:sys string pre src stat alt 数组 int public
原文地址:https://www.cnblogs.com/nnnnbbbb1/p/12930477.html