鏁扮粍鐨勫唴瀛樺浘
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了鏁扮粍鐨勫唴瀛樺浘相关的知识,希望对你有一定的参考价值。
鏍囩锛?a href='http://www.mamicode.com/so/1/sys' title='sys'>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 }
以上是关于鏁扮粍鐨勫唴瀛樺浘的主要内容,如果未能解决你的问题,请参考以下文章
leetcode 4. 瀵绘壘涓や釜姝e簭鏁扮粍鐨勪腑浣嶆暟