An array of Java SE learning--anonymous arrays and irregular arrays

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.