Tuesday, July 27, 2010

C # Learning Notes (April 3)


Public type system (Common Type System) built a set of data types, provide. NET languages define variables, use variables, management variables type of common rules.

C # type can be divided into two categories: one is a real value type (Value Type), configured in the stack (stack) which is always not as null; and those for the reference type (Reference Type), configure them in the Managed Heap . C # is type-safe language, is not allowed to use the variable before the variable initialization.

Learn C # and the relevance of operands is important priorities, contribute to the operation of the process of writing applications, and application debugging.

Use conversion operation can be clearly the number of the type into another type, but the conversion to note whether an overflow issues in order to allow programs to a more stable implementation.

C # provides a number of statements can be used to control program flow. Common choice statements: if, switch to a specific value or statement to decide whether or not the implementation code. Repeat statement: such as while, do, for, foreach can repeat a section of code several times. Jump statements: like goto, break, continue, etc., used to control the conversion process.

To be more stable applications implemented in the programming will have to be careful when handling an exception error, in order to avoid the user in operation due to unexpected movements such as opening a file does not exist, the encounter program infinite loop problem. When the C # application program execution when an error occurs, the system generates an exception error, you can use in C #, try ... catch catch the error and prompts the user instructions appropriate information. If the system error handler can not meet the needs of programmers can write their own inherited class System.Exception exception type.

using System; class Method (public static void MyMethod () (Console.WriteLine ("This is a method (Method) is nothing but a bunch of C # code in the set."); Console.WriteLine ("method in a different language different names: such as functions, subroutines, etc. ");) public static int Main () (Console.WriteLine (" This is a method, Main, WriteLine and MyMethod are three ways this code "); MyMethod (); Return 0;))
In C # all the way to a member of a class, which allows other global functions, global vice procedure programming language (such as C, C + +, VB, etc.), not the same place.






Recommended links:



Covert Surveillance Comments



Peng Yi QING years harvest



TOM parted ways with the ICQ IM New aborted last MINUTE



Mkv



The brilliant idea to Computer speed Do not waste your big memory



Who won The dream of the vast cultural Kai



Articles about Teaching And Training Tools



Runners grab the East home



Contact Home Linkist Then The New Tactics: To Provide Professional Exhibition Space



convert .mov to .avi



mp3 to mp4



C language library function (K class letters)



Mpg To Dat



Purple Pass And Was Invited To The United States To Participate In HIMSS10 Exhibition



No comments:

Post a Comment