In fact, the friends familiar with these languages know that these languages are completely not comparable.
Due to the need for work, the recent need to revisit the C # language is inevitably influenced by the fundamentals of C and OC.
This is one of my study notes, only dedicated to have C/OC Foundation, need to continue to learn C # friends.
The starting address of the blog: Http://blog.csdn.net/duzixi
continue to update the future, welcome to add Amendments (last update: 2014.11.6)
1th Basics: Constant variable operator expression statements* * * * The basic types provided by C # are more, more finely divided
* * * * BOOL type is bool type in C #, strictly different from shaping
* * * * console input in C # is a character stream, get other types that need to be converted using the Parse methodint a = Int. Parse (Console.ReadLine ());
* * * The Declaration and implementation of C # does not separateThe essence of C # (third edition) p.121
2nd talk about branching structure* * * * * The value of the switch expression in C # can also be a string type
3rd loop Structure Array
* * * * The array nature of C # is an
System.Array object. It is an abstract base type for all array types. Must be instantiated. when declaring an array, the square brackets ([]) must follow the type, not the identifier, and the size of the array is not part of its type. such as:bool[], byte[], int[], float[], double[], string[],
* * * * The array of two-dimensional arrays and arrays (jagged arrays) in C # is two thingstwo-dimensional array definitions:string[,] names; Jagged Array (jagged Array): byte[][] scores;http://msdn.microsoft.com/zh-cn/library/aa288453 (v=vs.71). aspx
* * * * The array in C # can be assigned directly, but as with C cannot do the addition and subtraction operations directly
4th enumeration and struct* * * * Enumeration in C # is not a mere shaping constanthttp://msdn.microsoft.com/zh-cn/library/cc138362.aspx
* * * * * The structure in C # is more powerful and flexible, it can directly contain methods
* * * * The member variable type modifier for struct in C # must be public structs can implement interfaces, but they cannot inherit another structure. Therefore, struct members cannot be declared as protected. http://msdn.microsoft.com/zh-cn/library/ah19swz4.aspx
5th Lecture Reference type String* * * * C # has a unique reference type, which is boxedvalue type will be thrown into the heap after boxinghttp://msdn.microsoft.com/zh-cn/library/yz2be5wk.aspx
* * * * The string of C # is a class
6th Lecture Class
* * * * * classes in C # contain methods, properties, fields, events, delegates, and internally nested classes.http://msdn.microsoft.com/zh-cn/library/ms173113.aspxA class can contain declarations for the following members:
Constructors (Constructor)
Destructors
Constant (const)
Fields (field)
Methods (method)
Attribute (property)
Indexer(indexers)
Operator (Operator)
Events (Event)
Delegate (Delegate)
Classes (Class)
Interface (Interface)
Structure (struct)
* * * * modifiers in C # are particularly rich and can be modified in many things1. Access levels, control of valid scopes, and permissions: public protected private internal2. Controlling the memory allocation area: static const3. Declaring a function parameter: Ref out params4. Actual situation: Virtualhttp://msdn.microsoft.com/zh-cn/library/9fkccyh4.aspx
* * * access rights
classes that can be declared directly within a namespace in other classes, are not nested, can be public or internal. By default, the class is internal.
class members, including nested classes, can be public,protected internal, protected, internal, or private. By default, members are private.
http://msdn.microsoft.com/zh-cn/library/0b0thckt.aspx
* * * properties of C #It could be a write-only.Created on the basis of a field, with uppercase letters at the beginning of the property
* * * * C functions can only be defined within a class
* * * * has sealed class C #
* * * There is a base statement in C #constructors can use the base keyword to invoke the constructor of the base class. http://msdn.microsoft.com/zh-cn/library/ms173115.aspx
7th Lecture Method (function)
* * * * The methods of C # can only appear in classes and structs
* * * * The concept of a method signature in C #method name parameters and parameter typesHttp://msdn.microsoft.com/zh-cn/library/ms173114.aspx
* * * * The function parameters of C # are modifiersref: Reference parameterout: Output parametersparams: one-dimensional arrays
* * * * The destructor frees memory resources in C #
* * * There are virtual methods in C #http://msdn.microsoft.com/zh-cn/library/9fkccyh4.aspx
* * * * called method signature in C #
8th Speaking Object-oriented* * * * * The two classes in C # that have inheritance relationships are called base classes and derived classes, respectivelyWhen a base class declares a method as virtual, the derived class can override the method with its own implementation. Http://msdn.microsoft.com/zh-cn/library/ms173149.aspx?sentenceGu=431ef25c6bea78755c146f18e5e213ae#mt9
* * * * The polymorphic comparison polymorphism of C #, there are many ways to implement
9th Static class and abstract class
* * * * * static classes and abstract classes are unique to C #
10th Talk interface and generics * * * * The interface of C # is similar to OC protocol
http://blog.csdn.net/byondocean/article/details/6871881
11th Lecture Collection* * * * * The collection of C # is divided into generic and non-generic collectionshttp://msdn.microsoft.com/zh-cn/library/yz2be5wk.aspx
12th talk about delegates and events* * * * The delegate of C # is similar to the C function pointer, but type safe, has been encapsulated into a type
* * * * The Observer design pattern for C # is implemented by delegates and events
13th talk Reflex* * * * reflection is unique to C #
In general, the sense of C # modifiers is particularly rich, and the content of modifiers is still being collated.
C # differs from C and OC points