Java数组

数组分为一维数组和多维数组,使用方法如下:

一维数组:int [] array = new int[10] == int array[]; array = new int[10] == int array = {1,2,3,4,5}...

二维数组:int [][] array = new int[10][5] == int array[][] = new int[10][5]...

              int [][]array = new int[10]; array[0] = new int[4]; array[1] = new int[10]...

常用和数组相关的函数:

数组复制:System.arraycopy(source,start_source,dest,dest_start,count) == 将source中从start_source位置开始的count个元素复制到dest数组从dest的dest_start索引位置开始存储

数组排序:Array.sort(array); 默认对array数组进行正序排序

posted @ 2014-03-25 19:51  雨后de寂寞  阅读(100)  评论(0编辑  收藏  举报