首页 > 代码库 > C# for Beginner
C# for Beginner
session 1 Introduction
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 2 Reading 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 Preffered
C# is case sensitive
session 3 Built - 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
Decimal Types
String Type
session 4 String type in c#
talk about escape \n,\‘,\" and etc. sometimes using @ to not escape
session 5 Common Operators in c#
Assignment operator =
Arithmetic operator +,-,*,/,%
Comparison operator like == , != , > , >= , < <=
Conditional operator like && , ||
Ternary operator ?:
Null coalescing operator ??
C# for Beginner