Basic knowledge of C #

Source: Internet
Author: User

Character type char , which stores a character enclosed in "(single quote)

String Type a string that stores a string of characters enclosed in "" (double quotation marks),

Integer type int , which stores integers

Double-precision floating-point double , storing decimals

logical operators are used to concatenate multiple bool type expressions to achieve compound judgments of multiple conditions. logical operators in C # include: logical non (!), logical AND (&&), logical, or (| |).

Operator Precedence for C #

brackets . The C # language is the same, if you have multiple brackets, you have to calculate from the inside out. Parentheses have the highest precedence.

a unary operator . Some operators have 2 operands on either side, such as 2+3, 6%5, and so on, which are called two-dollar operators . Only one operand is called a unary operator , and their precedence is higher than the two-dollar operator. Unary operators include:+ + (self-added),-(self-subtraction),! (logical).

* (multiply),/(except),% (take the remainder).

+ (plus),-(minus).

> (greater than), < (less than), >= (greater than or equal), <= (less than or equal).

= = (equals),! = (not equal to).

&& (logic and).

| | (logical OR).

The ⑨ assignment operator . Includes: =, + =,-=, *=,/=,%=.

Also, it is important to note that operators with the same precedence are evaluated from left to right (the assignment operator is reversed).

Basic knowledge of C #

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.