In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the relevant knowledge of "what needs to be mastered in C#entry knowledge points". In the operation process of actual cases, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!
C#(pronounced "See Sharp") is a simple, modern, object-oriented, and type-safe programming language. C#originated in the C language family, so C, C++, and Java programmers are quickly familiar with it. C#has been certified to ECMA International and ISO/IEC standards ECMA-334 and ISO/IEC 23270 respectively. Microsoft's C#compiler for the. NET Framework is implemented according to these two standards.
C#is an object-oriented language, but C#further supports component-oriented programming. Modern software design increasingly relies on software components in the form of self-contained and self-describing function packages. The key to such components is that they provide a programming model with attributes, methods, and events; they also have attributes that provide information about component declarations; and they are documented in their own way. C#provides language artifacts to directly support these concepts, making C#very natural in creating and using software artifacts.
C#features support the creation of robust and persistent applications: garbage collection features automatically reclaim memory space occupied by unwanted objects; exception handling provides a structured and extensible way to detect and recover errors; and the language's type-safe design prevents references to uninitialized variables, array subscripts out of bounds, and unchecked type conversions.
C#has a uniform type system. All C#types, including primitive data types such as int and double, inherit from a single root type object. Therefore, all types share a common set of operations, and values of any type can be stored, passed, and manipulated in a consistent manner. C#supports user-defined reference types and value types, allowing both dynamic allocation of objects and inline storage of lightweight structures.
To ensure that C#programs and libraries are always upgraded in a compatible manner, versioning is heavily emphasized in C#design. Many programming languages pay little attention to this, and programs written in those languages often fail to work because of updates to the libraries they depend on. Design aspects of C#are directly influenced by version considerations, including separate virtual and override modifiers, rules for method overloading, and support for declarations of explicit interface members.
Learning a programming language usually starts with the "Hello, World" program. Here is the C#entry:
using System; class Hello { static void Main(){ Console.WriteLine("Hello,World"); } }
C#source files generally use the.cs extension. Assuming that the "Hello, World" source file is saved as hello.cs, the program can be compiled by the Microsoft C#compiler using the following command line:
csc hello.cs
It will produce an executable assembly named hello.exe. When the program runs, the output is as follows:
Hello,World
The "Hello, World" program begins with the using directive, which references the System namespace. Namespaces provide a means of organizing C#programs and libraries hierarchically. Namespaces contain types and other namespaces, for example, the System namespace contains several types, such as the Console class referenced in programs, and several other namespaces, such as IO and Collections. If a given namespace is referenced through the using directive, members of the namespace can be used without qualification. It is because of the use of the using directive in the program that System.Console.WriteLine can be abbreviated to Console.WriteLine.
The Hello class declared in the "Hello, World" program has only one member, a method named Main. Main methods are declared with the static modifier. Static methods differ from instance methods, which require the keyword this to refer to a specific object instance, and static methods do not require a specific object to be referenced for their operations. By convention, a static method named Main acts as the entry point for the program.
Program output is generated by the WriteLine method of the Console class under the System namespace. This class is provided by the. NET Framework class library, which by default is automatically referenced by the Microsoft C#compiler. Note that C#itself does not have a separate runtime class library. In fact, the. NET Framework is a runtime library for C#.
"C#entry knowledge point needs to master what content" content is introduced here, thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.