2016/04/26 C # arrays

Source: Internet
Author: User

        /** Array: A collection of data used to hold a set of data * * * before you create an array you need to be aware of what type of data the array needs to store * How many data are stored in the array         * * Common array notation * data type [] array name =new data type [number of data to be stored in array];         * * For example: int[] arr=new int[3]; * * * A. int[] is a 1 data type.         read as an int array. * B. arr is a 1 variable.         The type of this variable is an int array type.         * C. New int[3]; This is an expression of 1. The result of this expression is the value of the ARR variable.; *          *          *           */        int[] arr =New int[3]; /** 12. Initializer for an array: assigns a value to the elements of an array while declaring it.           * Write the values of the elements in the braces and separate them with commas. * A. The type of the data must be the same as the type of the element * B. The number of data in the braces is the same as the length of the array.         No more and no less.         * * int[] arr = new Int[4] {10, 20, 30,40};         * * int[] arr = new int[] {10, 20, 30, 40, 50, 6, 132};         * The length of the array is determined by the number of elements in the braces.         * * int[] arr = {10, 20, 30, 40, 50, 6, 132, 31, 342, 4, 35, 46, 67, 78, 1}; * You can also not write new int[] ... Length is determined by the number of elements we give,*/        //int[] arr = new Int[4] {10, 20, 30, 40}; //int[] arr = new int[] {Ten, 6 , +------------        int[] arr = {Ten, -, -, +, -,6, the, to,342,4, *, $, the, +,1};

2016/04/26 C # 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.