Tju_scs_c# Study notes (4)

Source: Internet
Author: User

I. Classroom content

This week's lectures are more informative, with struct structs, interface interfaces, and some of the features in C # arrays, such as the way special multidimensional arrays are declared, as well as irregular arrays and templates, stacks, dictionaries and so on, as well as string strings and some of the contents of regular expressions.

Two. Learning content

1. The first practice of the relevant content of the interface, the previous learning C + +, and Java when the interface is not well understood, in C # class to understand what is the interface, interface and abstract class A bit similar, both can be inherited, but the abstract class can only be inherited, and the interface can be multiple inheritance , in order to prevent the interface pollution, so the interface can not be too much functionality, I did a simple exercise:

On the difference between abstract class and interface, I found this on the Internet, I think it is more easy to help me understand:

2. In the practice of arrays, the first params of this new keyword has never been seen before, and some online explanations have been found:

Follow the example on the PPT and try it and get the following result:

On the declaration of multidimensional arrays I have explored some of the first notes before, and I will not repeat them.

The irregular array is still relatively fresh, and I followed the example by doing the following exercises:

There are also special declarations of lower bound and upper bound arrays:

There is also a dictionary dictionary, with <key, value> pair to access data and processing, the following exercises:

or use key to access value in foreach, as follows:

These are some of the small exercises I've done with the array.

3. Then the string, PPT, says that the string is an immutable Unicode sequence, and the following exercises can prove its immutability:

Then there is a little understanding about the regular expressions that follow, such as this:

The @ keyword is de-escaped, and the regex can search the string with a static method instance method, but the meta-character of the regular expression kerning in complex = =, 1:30.

Three. After-school impressions

Every programming language has the same place, but there are different special places, the reason is the same, but the form slightly different, more study more ask more see, go ahead, c#!

Tju_scs_c# Study notes (4)

Related Article

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.