当前位置:网站首页>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
边栏推荐
- [leetcode 954] double pair array
- [leetcode217] there are duplicate elements
- IO multiplexing of 09 redis
- Practical operation - Nacos installation and configuration
- SQL injection
- Pytoch -- data loading and processing
- 12. Monkeys climb mountains
- [leetcode 54] spiral matrix
- String notes
- [leetcode169] most elements
猜你喜欢
![Paper on Image Restoration - [red net, nips16] image restoration using very deep revolutionary encoder decoder networks wi](/img/1b/4eea05e2634780f45b44273d2764e3.png)
Paper on Image Restoration - [red net, nips16] image restoration using very deep revolutionary encoder decoder networks wi
![图像恢复论文——[RED-Net, NIPS16]Image Restoration Using Very Deep Convolutional Encoder-Decoder Networks wi](/img/1b/4eea05e2634780f45b44273d2764e3.png)
图像恢复论文——[RED-Net, NIPS16]Image Restoration Using Very Deep Convolutional Encoder-Decoder Networks wi
![[leetcode 54] spiral matrix](/img/c0/9a55a62befb783a5bfc39dc3a96cb2.png)
[leetcode 54] spiral matrix

線性代數第一章-行列式
![Unsupervised denoising - [tmi2022] ISCL: dependent self cooperative learning for unpaired image denoising](/img/cd/10793445e6867eeee613b6ba4b85cf.png)
Unsupervised denoising - [tmi2022] ISCL: dependent self cooperative learning for unpaired image denoising

Integration and induction of knowledge points of automatic control principle (Han min version)

编程记录——图片旋转函数scipy.ndimage.rotate()的简单使用和效果观察

Explain of MySQL optimization

In depth understanding of the relationship between dncblevel and noise denoising in the paper

Pyqt5 learning (I): Layout Management + signal and slot association + menu bar and toolbar + packaging resource package
随机推荐
Custom exception class
3. Continuous integer
[leetcode 290] word rules
自動控制(韓敏版)
Chapter 3 of linear algebra - Elementary Transformation of matrix and system of linear equations
Pytorch learning record (7): skills in processing data and training models
Denoising paper - [noise2void, cvpr19] noise2void learning denoising from single noise images
Reading of denoising papers - [cvpr2022] blind2blind: self supervised image denoising with visible blind spots
How does MySQL convert stored seconds into dates
2. Average length of words
[leetcode 459] duplicate substring
[transfer] MySQL: how many rows of data can InnoDB store in a B + tree?
St table template
Problems and solutions of database migration
[leetcode 350] intersection of two arrays II
JSP syntax and JSTL tag
Collections multiple parameter sorting
Doomsday (simple computational geometry)
Pytorch notes - get familiar with the network construction method by building RESNET (complete code)
Exception handling: grab and throw model