当前位置:网站首页>C # Foundation
C # Foundation
2022-04-23 06:24:00 【Wood acridine】
C# Basics
C# Language is a kind of language developed by Microsoft object-oriented Programming language . It is characterized by encapsulation 、 Inherit 、 polymorphic , And added events and delegates , Enhance the flexibility of programming .
characteristic :1、 Simple , Security .
2、 object-oriented
3、 Cross-platform support
4、 Can develop many types of programs
namespace Namespace name . Used to resolve naming conflicts .
When there are more than two named classes or methods with the same name , Use namespaces to distinguish which class or method we call .
C# The basic content of the program is contained in a namespace
F5 It is a shortcut key for debugging and running
Alt+F5 Direct operation
F11 Sentence by sentence . Each statement should be debugged and executed . When the function is executed , Enter the function to execute
F10 Process by process . Only perform each process . When the function is executed , Execute functions directly , Don't go inside the function .
shift+F11 Jump out of , Jump out of the function we are currently executing , Go back to the next level
C# Basic data type
Data types are mainly used to indicate the types of stored values of variables and constants .
C# The basic data types are Value type and Reference type .
Value type : plastic 、 floating-point 、 Character 、 Boolean type 、 enum .
Reference type : The class interface 、 Array 、 entrust 、 character string .
In basic data types , except string The others are value types .
The value type is passed Transfer value .
The reference type is passed The reference . Method
The storage unit of computer memory
bit position Values can represent 0 1( The smallest unit of computing memory ) Binary system
B Byte byte 1Byte=8bit
KB 1KB = 1024B
MB 1 MB =1024KB
GB 1GB = 1024MB
Basic data type — plastic
byte Unsigned byte type 1 Bytes 0~255 A signed sbyte -127~126
short Signed short shaping 2 Bytes Unsigned :ushort
int There's symbolic plastic 4 Bytes Unsigned :uint
long Signed long plastic 8 Bytes Unsigned :ulong
notes : A byte can only represent English letters and some symbols
floating-point
float Single precision floating point 4 Bytes
example :float num = 25.6f;
double Double precision floating point 8 Bytes
example :double dNum = 25.6;
decimal Higher precision floating point 16 Bytes
example :decimal decimalNum = 25.6M;
notes :C# Small and medium numbers think that double type
Character char 2 Bytes
Only one character can be stored , Need to be enclosed in single quotes
example :char c = ' I ';
String type
use string Deposit , It needs to be enclosed in double quotes
example :string str = " I'm a string ";
Boolean type bool
value :true and false
example :bool isOK=false;
notes
effect : Used to illustrate the meaning of the current code , Get rid of the code you don't need at the moment
The first one is Single-line comments //
example ://Write Output only without line breaks
Console.Write(" character string ");
The second kind Multiline comment /* Represents the beginning of a comment */ Represents the end of the comment
example :/* int num = 5;
int result = 0;
*/
The third kind of Documentation Comments Generally used for the description of classes and methods
example : /// <summary>
/// This is a startup method ,Main Method
/// </summary>
/// <param name="args"></param>
static void Main(string[] args) { }
Comment shortcut key
Comment on an area as a whole :Ctrl+K+C
Uncomment an area :Ctrl+K+U
版权声明
本文为[Wood acridine]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210616405340.html
边栏推荐
- Reading of denoising papers - [cvpr2022] blind2blind: self supervised image denoising with visible blind spots
- Rainbow (DP)
- Use Matplotlib. In Jupiter notebook Pyplot server hangs up and crashes
- Linear algebra Chapter 1 - determinant
- 深入理解去噪论文——FFDNet和CBDNet中noise level与噪声方差之间的关系探索
- Protected (members modified by protected are visible to this package and its subclasses)
- C3p0 database connection pool usage
- JDBC operation transaction
- 程序設計訓練
- Example of reentrant lock thread waiting to wake up
猜你喜欢
Kalman filter and inertial integrated navigation
线性代数第三章-矩阵的初等变换与线性方程组
In depth understanding of the relationship between dncblevel and noise denoising in the paper
String notes
线性代数第二章-矩阵及其运算
Linear algebra Chapter 1 - determinant
Automatic control (Han min version)
Unsupervised denoising - [tmi2022] ISCL: dependent self cooperative learning for unpaired image denoising
JDBC connection database
Integration and induction of knowledge points of automatic control principle (Han min version)
随机推荐
Explain of MySQL optimization
Pytorch notes - get familiar with the network construction method by building RESNET (complete code)
MySQL advanced query
[leetcode 202] happy number
2. Average length of words
檢測技術與原理
Linear algebra Chapter 2 - matrices and their operations
Stability building best practices
Pytorch notes - observe dataloader & build lenet with torch to process cifar-10 complete code
4. Print form
Failure to deliver XID in Seata distributed transaction project
Complete example demonstration of creating table to page - joint table query
Pytorch introduction notes - use a simple example to observe the output size of each layer of forward propagation
Collection and map thread safety problem solving
Addition, deletion, modification and query of MySQL table
程序設計訓練
自动控制(韩敏版)
Exception handling: grab and throw model
RPC must know and know
线性代数第三章-矩阵的初等变换与线性方程组