A
C#
Features of the language:
A
Universal, cross-platform support
b
Simple, mainly reflects the characteristics of garbage collection, reference, etc.
C
Object-oriented design
D
And
Web
Application of tight bonding
E
Security mechanisms
F
Compatibility
G
Flexible version-processing technology
H
C#
Provides a complete error and exception triggering mechanism
Two Simple.
C#
Programming Syntax:
Using
System;
Using
System.Collections.Generic;
Using
System.Linq;
Using
System.Text;
Namespace
Sample1_1
//
namespace of the defined project
{
Class
Program
//
Defines the class
{
Static
void
Main (
String
[] args)
//
Defined by
Main
Function
{
Console
. WriteLine (
"
Please enter your name:
"
);
//
Output to the screen
String
Name =
Console
. ReadLine ();
//
Reading data entered by the user
Console
. WriteLine (
"{0}
Welcome here.
c#4.0
World
"
, name);
}
}
}
Three
C#
Language variables, constants, and data types:
A
Variable: variable data type
Variable names (identifiers) or
Variable data type
Variable names (identifiers)
=
Variable Value
b
Constant:
Const
Constant data type
Constant Name (identifier)
=
Constant value
C
Data type:
C#
is a strongly typed language
I.
Value type: derived from
System.Object
Of
System.ValueType
Derived, declares a variable
With the stack.
1.
Simple Type:
SByte
BYTE type
Short
Short-integer
Int
Integral type
Long
Long integer type
Float
Floating point
Type
Double
Double-precision floating-point type
Char
Character type
bool
Boolean type
2.
Collection type: With
Enum
Statement
3.
Structure type: With
struct
Statement
Ii.
Reference type: Assigned to the heap
1.
Class Type:
2.
Object type
3.
String type: With
String
Statement
4.
Interface type: With
Interface
Statement
Basic knowledge of C #