当前位置:网站首页>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
边栏推荐
- POJ - 2955 brackets interval DP
- POI and easyexcel exercises
- Example of reentrant lock thread waiting to wake up
- [leetcode 954] double pair array
- Guaba and Computational Geometry
- 8. Integer Decomposition
- 2. Devops sonar installation
- Installation and usage skills of idea
- 卡尔曼滤波与惯性组合导航
- @Problems caused by internal dead loop of postconstruct method
猜你喜欢

图像恢复论文简记——Uformer: A General U-Shaped Transformer for Image Restoration
Best practices for MySQL storage time

Chapter 4 of line generation - linear correlation of vector systems

Guaba and Computational Geometry

Kalman filter and inertial integrated navigation

Installation and usage skills of idea

Generate excel template (drop-down selection, multi-level linkage)

Algèbre linéaire chapitre 1 - déterminants

Kibana search syntax

The bottom implementation principle of thread - static agent mode
随机推荐
In depth understanding of the relationship between dncblevel and noise denoising in the paper
图像恢复论文——[RED-Net, NIPS16]Image Restoration Using Very Deep Convolutional Encoder-Decoder Networks wi
11.a==b?
DBCP usage
Framework analysis 1 Introduction to system architecture
Collections multiple parameter sorting
[leetcode 54] spiral matrix
Numpy common function table sorting of data processing
Pytorch learning record (V): back propagation + gradient based optimizer (SGD, adagrad, rmsporp, Adam)
Viewer: introduce MySQL date function
Why does the subscript of the array start from 0 instead of 1?
Example of ticket selling with reentrant lock
JDBC operation transaction
Integers have friends interval GCD + double pointer
6.Reversal
5.The Simple Problem
Framework analysis 2 Source code - login authentication
2. Average length of words
JSP syntax and JSTL tag
Protected (members modified by protected are visible to this package and its subclasses)