Re-learning C # Advanced Programming (generics and arrays)

Source: Internet
Author: User

The previous period of time work relatively busy, there is no writing essays, and now continue.

The first two days re-read the generics and the two chapters, simply say my own harvest

  Generic type

We know that arrays are a batch of data formats, and generics are actually a custom bulk data format, and when arrays and C # existing generic classes list and dictionary<k,v> do not meet our requirements, we can create our own generic classes, Specifically how to create it is not here to explain, to create a solution to find it (personally feel that there is no need to tangle each function how to achieve, really want to use when you can go online search for a lot of implementation, we just know there is such a solution, you can achieve such a function on the line).

Generic classes are strongly type-constrained, meaning that when a generic object is created, it restricts the types of objects that the series can store.

  Array

Arrays are used when we need to batch the data, and the function of the array in the program is similar to that of the basic data type. Arrays have two-dimensional arrays and multidimensional arrays, usually using two-dimensional arrays more. The array length needs to be specified when creating an array normally. When you do not specify an array length, you need to specify the values for each node of the array at the same time, and the program runs to reverse the length of the array based on the number of nodes specified.

Re-learning C # Advanced Programming (generics and 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.