亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb

首頁 > 學院 > 開發設計 > 正文

C# for Beginner session 1 to 10

2019-11-17 02:42:20
字體:
來源:轉載
供稿:網友

C# for Beginner session 1 to 10

session 1Introduction

The struct of C# PRogram:

namespace , class and Main method

what is namespace?

the namespace declaration, using System, indicates that you are using the System namespace.

A namespace is used to organize your code and is collection of classes, interfaces, structs,enums and delegates.

Main method is the entry point into your application

session 2Reading and writing to a console

Reading from the console and Writing to the console

2 ways to write to console

a) Concatenation(+)

b) Place holder syntax -Most Preferred(占位符 ,推薦用這種)

C# is case sensitive (對大小寫敏感)

session 3Built - in types

Boolean type --Only true or false

Integral Types --sbyte,byte,short,ushort,int,uint,long,ulong,char. how to know Integral Types Value? using MinValue and MaxValue property

Floating Types--float and double , double type is default type ,if you want to declare a float type ,you should add F at end ,else,it will get an error

Decimal Types

String Type

session 4String type in c#

talk about escape /n,/',/" and etc. sometimes using @ to notescape(轉義)

session 5Common Operators in c#

Assignment operator =(賦值運算符)

Arithmetic operator +,-,*,/,%

Comparison operator like == , != , > , >= , < <=

Conditional operator like && , ||

Ternary operator ?:

Null coalescing operator ??

session 6Nullable Types

Types in C#

In C# types are divided into 2 broad categories

Value Types --int, float, double, structs, enums etc

Reference Types -- Interface, Class, Delegetes, arrays etc

By default value types are non nullable. To make them nullable use?

int i = 0(i is non nullable, so i cannot be set to null, i = null will generate compiler error)

int? j = 0(j is nullable int, so j = null is legal)

Nullable types bridge the differences between C# types and Database types

about ?? operator , eg: int? i = 100 or null, in j = i ?? 0. it means if i is null, then j = 0 ,else ,i =j

Session 7Datatypes conversion

Implicit conversions(隱式)

Explicit conversions(顯式)

Difference between Parse() and TryParse()

implicit & explicit conversion

implicit conversion is done by the complier:

1, when there is no loss of information if the conversion is done

2,if there is no possibility of throwing exceptions during the conversion

Example: Converting an int to a float will not loose any data and no exception will be thrown, hence(因此) an implicit conversion can be done.

Where as when converting a float to an int , we loose the fractional(小數點后的數) part and also a possibility of overflow exception. Hence, in this case an explicit conversion is required. For explicit conversion we can use cast operator or the convert class in C#

Diffrence between Parse(解析) and TryParse

if the number is in a string format you have 2 options --int.Parse() and int.TryParse()

Parse() method throws an exception if it cannot parse the value, where as TryParse() returns a bool indicating whether it succeeded or failed , so ,Use Parse() if you are sure the vlue will be valid, Otherwise, use TryParse()

Session 8Arrays in C#

an array is a collection of similar data types.

Advantages:Arrays are strongly typed.

Disadvantages:Arrays cannot grow in size once initialized.

Have to rely on integral indices to store or retrieve items from the array.(必須依靠索引來存儲或檢索項目從數組。)

Session 9 Comments in C#

single line Comments        -//

Multi line Comments        -/* */

xml Documentation Comments   -/// if using this comment ,when you mouSEOver it ,it can show comment to you

Comment are used to document what the program does and what specific blocks or lines of code do. C# complier ignores comments

To Comment and Uncomment , there are 2 ways

1, Use the designer

2, Keyboard Shortcut: use Ctrl+K or Ctrl+C to comment and use Ctrl+K or Ctrl+U to uncomment

Note:Don't try to comment every line of code. User comments only for blocks or lines of code that are difficult to understand

Session 10If statement in C#

if statement

if else statement

Difference between && and &

Difference between || and |

take example:

int number = int.TryParse(Cosole.ReadLine());

if(number ==0 && number ==10) //if number >0,it will not exce condition number ==10

if(number ==0 & number ==10) // though number>0 it will exce condition number==10,so, it is one more step than &&. the meaning about || and | also like that.


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb
国产成人91久久精品| 亚洲国产欧美一区二区丝袜黑人| 欧美成人午夜影院| 国产精品视频xxx| 深夜精品寂寞黄网站在线观看| 亚洲激情国产精品| 亚洲深夜福利网站| 亚洲大胆美女视频| 亚洲xxxxx| 欧美日韩国产中文字幕| 日韩精品电影网| 久久天天躁狠狠躁夜夜躁| 国产婷婷97碰碰久久人人蜜臀| 国模叶桐国产精品一区| 久久青草精品视频免费观看| 久久久久久亚洲精品| 亚洲欧洲一区二区三区在线观看| 日韩一级黄色av| 国产欧美日韩丝袜精品一区| 日韩av电影手机在线观看| 亚洲精品电影在线| 欧美一级大片视频| 国产精品久久久久久久久粉嫩av| 国产成人aa精品一区在线播放| 亚洲无线码在线一区观看| 久久这里只有精品99| 黑人精品xxx一区| 久久久天堂国产精品女人| 中文字幕亚洲欧美日韩高清| 久久夜色精品国产欧美乱| 久久电影一区二区| 国产精品第1页| 亚洲综合在线小说| 国产精品日韩av| 欧美日韩国产一区中文午夜| 日韩高清免费观看| 亚洲欧洲在线免费| 久久久人成影片一区二区三区观看| 欧美另类高清videos| 69久久夜色精品国产69| 国产亚洲精品久久久久久777| 亚洲第一国产精品| 久久精品影视伊人网| 国产一区二区三区在线视频| 国产精品国产三级国产aⅴ浪潮| 日韩精品免费观看| 国产精品海角社区在线观看| 久久综合伊人77777尤物| 国产精品亚洲综合天堂夜夜| 欧美黑人性视频| 国产精品美女主播在线观看纯欲| 理论片在线不卡免费观看| 黄色精品在线看| 国产精品av在线播放| 亚洲free性xxxx护士hd| 日韩久久精品电影| 免费91麻豆精品国产自产在线观看| 色综合久久悠悠| 最新中文字幕亚洲| 亚洲国产成人精品一区二区| 国产偷亚洲偷欧美偷精品| 亚洲xxx自由成熟| 欧美日韩国产区| 欧美一区三区三区高中清蜜桃| 亚洲男人天堂网| 久久精品视频在线观看| 色婷婷亚洲mv天堂mv在影片| 国产一区二区三区中文| 欧美国产第二页| 久久视频在线免费观看| 亚洲一区二区精品| 国外成人在线播放| 成人乱人伦精品视频在线观看| 国产精品自拍偷拍视频| 亚洲精品美女在线观看| 伊人亚洲福利一区二区三区| 亚洲国产精品成人av| 亚洲人精品午夜在线观看| 懂色av中文一区二区三区天美| 亚洲成avwww人| 国产精品稀缺呦系列在线| 成人激情视频小说免费下载| 国产精品久久久久久久久久尿| 亚洲男人天堂九九视频| 久久久久久久成人| 欧美激情一区二区三区高清视频| 国内外成人免费激情在线视频网站| 亚洲第一视频网| 91免费看片在线| 琪琪亚洲精品午夜在线| 在线日韩日本国产亚洲| 日韩精品在线观看网站| 欧美精品少妇videofree| 韩国欧美亚洲国产| 亚洲aaaaaa| 91欧美日韩一区| 欧美人与性动交| 国产一区二区免费| 一本色道久久综合狠狠躁篇的优点| 中文字幕日韩高清| 国产精品日韩av| 欧美伊久线香蕉线新在线| 国产啪精品视频网站| 成人做爰www免费看视频网站| 日本精品久久久| 日本精品在线视频| 中文字幕久热精品视频在线| 91av免费观看91av精品在线| www.日韩免费| 亚洲欧美一区二区激情| 精品国偷自产在线视频99| 丁香五六月婷婷久久激情| 欧美超级免费视 在线| 久久综合网hezyo| 韩国精品久久久999| 中文字幕亚洲在线| 亚洲国产毛片完整版| 日韩中文字幕免费看| 亚洲日韩欧美视频一区| 日韩免费高清在线观看| 国产精品福利网站| 久久97久久97精品免视看| 正在播放国产一区| 日韩一中文字幕| 精品动漫一区二区三区| 欧美美女15p| 久久久免费精品视频| 久久精品在线播放| 欧美激情综合亚洲一二区| 日韩一二三在线视频播| 久久久久中文字幕2018| 91中文在线视频| 日韩中文在线观看| 亚洲人成网在线播放| 国产专区欧美专区| 国产精品高潮呻吟视频| 人体精品一二三区| 日韩黄色av网站| 人人澡人人澡人人看欧美| 国产精品igao视频| 日韩在线资源网| 欧美精品一区二区免费| 国产视频福利一区| 欧美午夜视频在线观看| 国内精品久久久久久久久| 欧美乱大交xxxxx另类电影| 亚洲精品福利在线| 国产大片精品免费永久看nba| 亚州国产精品久久久| 国产精品黄色影片导航在线观看| 国产精品爱啪在线线免费观看| 91黑丝在线观看| 国产精品久久久久久av福利软件| 国产91露脸中文字幕在线| 欧美激情精品久久久久久变态| 久久久久久久久国产精品| 精品美女永久免费视频| 国产中文日韩欧美| 国产在线视频91| 国产成人精品综合| 欧美高清激情视频| 国产精品一区二区久久精品| 亚洲免费一在线| 久久久成人av|