C # Array

Source: Internet
Author: User
The System. Array class provided in C # is the base class of all Array types.

In C #, Arrays can be one-dimensional or multi-dimensional. arrays and uneven arrays are also supported.
Using System;


Class Test

{

Static void Main () // The length of the dynamically generated Array

{

String [] a1; // One-Dimensional string Array

String [,] a2; // two-dimensional

String [,] a3; // 3D

String [] [] j2; // variable array

String [] [] [] [] j3; // multidimensional variable array

}

}


Class Test2

{

Static void Main2 () // The length of the dynamically generated Array

{

Int [] a1 = new int [] {1, 2, 3 };

Int [,] a2 = new int [,] {1, 2, 3}, {4, 5, 6 }};

Int [,] a3 = new int [10, 20, 30];

Int [] [] j2 = new int [3] [];

J2 [0] = new int [] {1, 2, 3 };

J2 [1] = new int [] {1, 2, 3, 4, 5, 6 };

J2 [2] = new int [] {1, 2, 3, 4, 5, 6, 7, 8, 9 };

}

}

Referenced from:

Http://www2.cnblogs.com/netfork/archive/2004/03/22/3836.html

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.