C # Language Basics (accompanying notes)

Source: Internet
Author: User

Write some of the notes that you remember, which is another notebook.

C#


Data Type
string is a reference type; Int,double is a value type;
string= string (not numeric/), int= Integer (not decimal) long= integer (larger than int); double (large value) ;
Type Conversions
( cast/implicit conversions); (there is no coercion between the reference value and the value);
casts are preceded by a variable (for example, int\double), and can only be applied to conversions between numeric values, preceded by a variable (type).
implicitly converts convert. to (Console.readine ());//convert. Todouble\tostring\toint32; Int.parse (Console.readine ());
operator
Arithmetic: +-*/% + +--; (++\ to add 1)
+ + (variable + +, Post + + first assignment, after operation; + + variable, first operation, then assignment);
Relationship:> < >= <= = = = (bool//compares a value to bool to receive this value) for judgment;
logic: (&&) with (and); ) or; (! Non.//priority in the top level of this table, only for the bracketed content followed by, and when and and or when it appears in a piece, the first count and (the operator priority);
Condition: (? :) If-otherwise;
Statement
Sequential statements:
branching statements: if else;if nested; swith (variable) case (Case1,case2,case3 ... ) (Swith is unable to do greater than);
Loop statement for; while, if (e.g.) {"I ate a stone" continue;} if (for example) {stop loop break;} (for starting from 0 less than, starting from 1 less than equals;)
Jump statement:
Exception statement: Try---catch---finally

This is easy to read, maybe some day in the future, you can see ——————————

C # Language Basics (accompanying notes)

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.