Chapter III Implementation flow of the management program flow (in. net4.5)

Source: Internet
Author: User

1. Overview

This chapter includes Boolean expressions, flow control methods, collection traversal, and flow jumps.

2. Main content

* As the content of the chapter is relatively basic, the daily use of a lot, so the basic content of some commonly used not to repeat.

  2.1 Using Boolean expressions

Familiar with the following comparison operators: <, >=, <=, = =,! =.

Be familiar with the following logical expressions: &&, | |, ^.

BOOL true ; BOOL false  //False//true//false

  2.2 Program Flow control

C # provides flow control modes: If, while, does while, for, foreach, switch, break, continue, Goto,?? (Null-coalesce op),?:( Conditional op).

int NULL ; int NULL ; int z = x?? Y?? -1; The value of Z is-1

  2.3 Integrated Traversal

You can use for, foreach, while, and do and four ways to traverse.

foreach inch people) {    "Changed"//OK    New // Compile Error}

The reason for the above code compilation error is the way that foreach is implemented:

New people. GetEnumerator (); Try {person    v;      while (E.movenext ())          = e.current;} finally {    as  system.idisposable;     if NULL )        d.dispose ();}

Chapter III Implementation flow of the management program flow (in. net4.5)

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.