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)