Basic knowledge of C #

Source: Internet
Author: User

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 #

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.