This article is a summary of the study on the web and its own little practice, thank you for your selfless sharing.
Recently stumbled across an array of problems, learning about anonymous arrays and irregular arrays.
An anonymous array is suitable for use only once, and an irregular array is a case where the total number of data per row is indeterminate.
Here's my little example.
Package Se;import java.util.random;/** * <p> * Description: This method is for the learning of anonymous and irregular arrays * </p> * @author Zhangjunshuai * @version 1.0 * Create date:2014-10-24 PM 5:49:22 * Project name:java7thread * * <pre> * Modification History: * Date Author Version Description *---------------- -------------------------------------------------------------------------------------------* Lastchange: $Date:: $ $Author: $ $Rev: $ * </pre> * */public class Array {/** * <p> * </p> * @ Author Zhangjunshuai * @date 2014-10-24 pm 5:48:19 * @param args */public static void main (string[] args) {//1, use of anonymous arrays out1 ( New string[]{"1", "2"}), Out2 ("3", "4"); 2, the use of irregular arrays irregular ();} /* * Irregular array */static void irregular () {int arrays[][];arrays = new Int[3][];for (int i=0;i<arrays.length;i++) {/*random R = new Random (n); int h = r.nextint (+); */int h = (int) (Math.ranDom () *16); Arrays[i] = new int[h];for (int j=0;j
An array of Java SE learning--anonymous arrays and irregular arrays