C # Getting Started C # features and helloworld Program

Source: Internet
Author: User

C # IsSimple,Modern,Object-orientedAndType SecurityOfProgramming Language.

C # is developed by C and C ++. C # (Chinese pronunciation: "c saap", English pronunciation: C sharp) is firmly rooted in the C and C ++ languages. It is specially used by Microsoft.. NET platform.

Simple

C # One advantage that C ++ does not possess is that it is easy to learn. The primary goal of this language is simplicity. C # is easy to implement.

In C #, no pointers are popular in C ++. In C ++, there are:, and-> operators used for namespace, members, and references. For beginners, operators are still difficult to learn. C # discard other operators and only use a single operator ".".

Modern
For enterprise-level programming languages, the new financial data type (decimal) is very popular. You use a new decimal data type, which is used for financial computing.

Full memory management is no longer your task. A garbage collector is provided during runtime, responsible for C #ProgramMemory Management.

Object-oriented:
The core of C # Is Object-Oriented Programming. C # supports all key object-oriented concepts, such as encapsulation, inheritance, and polymorphism.

1. Encapsulation

Encapsulation is a program design mechanism, which is boundCodeAnd operation data, and make them not affected by external interference and misuse, so as to ensure security.

The basic unit of C # Is a class, which defines the form of an object and specifies the code for data and operations.

2. Polymorphism

It defines an interface and multiple methods.

3. Inheritance

It is a process in which an object obtains the attributes of another object.

Type Security

C # implement the strictest type security, so you must follow the rules of some variables in C #: you cannot use variables that are not initialized.

 

 

C # helloworld

Using system;
// A "Hello world! "Program in C #
Namespace helloworld
{
Class hello
{
Static void main ()
{
System. Console. writeline ("Hello world! ");
}
}
}

The first 2nd lines of code, which is a single line comment statement in C. Similar to C ++, C # supports two annotation methods: single-line comments starting with "//" and multi-line comments paired with "/*" and "*/" cannot be nested between comments.

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.