C# 编程语言概述外文文献翻译
(含:英文原文及中文译文)
文献出处:Barnett M. C# Programming Language Overview [J]Lecture Notes in Computer Science, 2016, 3(4):49-59.
关于水仙花的知识英文原文班超字仲升
C# Programming Language Overview
Barnett M
1. History of C, C++, C#
廖浩明The C# programming language is bad on the spirit of the C and C++ programming languages. This account has powerful features and an easy-to-learn curve. It cannot be said that C# is the same as C and C++, but becau C# is built on both, Microsoft has removed some features that have become more burdensome, such as pointers. This ction looks at C and C++ and tracks their development in C#.
The C programming language was originally defined in the UNIX operating system. In the past, we often wrote some UNIX applications, including a C compiler, and finally ud to write UNIX itlf. It is generally accepted that this academic competition extends to the world that contains this business. The original Windows API was defined to work with C using Windows code, and until now at least the core Windows operating system APIS maintains the C compiler.
From a defined point of view, C lacks a single detail, like the
language Smalltalk does, and the concept of an object. Y ou will learn more about the contents of the object. In Chapter 8, "Write Object-Oriented Code," an object is collected as a data t and some operations are t. The code can be completed by C, but the concept of the object cannot be Forced to appear in this language. If you want to construct your code to make it like an object, that's fine. If you don't want to do this, C will really not mind. The object is not an intrinsic part. Many people in this language did not spend a lot of time in this program example. When the development of object-oriented perspectives began to gain acceptance, think about the code approach. C++ was developed to include this improvement. It is defined to be compatible with C (just as all C programs are also C++ programs and can be compiled by a C++ compiler) The main addition to the C++ language is to provide this new concept. C++ additionally provides a derivative of the class (object te
怎么转发聊天记录mplate) behavior.
The C++ language is a modified version of the C language. Unfamiliar, infrequent languages such as VB, C, and C++ are very low-level and require a lot of coding to make your application run well. Reason and error checking. And C++ can be handled in some very powerful applications, the code works very smoothly. The goal is t to maintain compatibility with C. C++ cannot break the low-level features of C.
Microsoft defined C# retains a lot of C and C++ statements. The code can also want to identify the code quickly. A big advantage for C# is that its designers did not make it compatible with C and C++. When this may em like a wrong treatment, it is actually good news. C# eliminates something that makes C and C++ difficult to work with. Beginning with quirks and defects found in C. C# is starting a clean slate and does not have any compatibility requirements. So it can maintain the strengths of its predecessors and discard weakness that make C and C++ programs difficult to survive.
2. Introduce C#
C#, the new language introduced in the system, is derived from C++. However, C# is a popular, object-oriented (from beginning to end) type-safe language.
新学期目标简短
Language features
The following ction provides a quick perspective on some of the features of the C# language. If some of them are unfamiliar to you, don't worry, everything will be explained in detail in the following ctions. In C#, all code and data must be attached to a class. Y ou cannot define a variable outside the class, nor can you write any code that is not in the class. When a class object is created and run, the class is constructed. When the object of the class is relead, the class is destroyed. The class provides single inheritance, and all the class eventually get from the
ba class is the object. Over time, C# provides versioned techniques to help with the formation of your class to maintain code compatibility when you u code from your earlier class.
Let's look at an example of a class called Family. This class contains two static fields to hold the first and last names of family members. In the same way, there is a way to return the full name of a family member.单韵母图片
Class Class1
{
Public string FirstName;
Public string LastName;办法近义词
Public string FullName()
{
}
Return FirstName + LastName;
}
Note: Single inheritance means that a C# class can only inherit from a ba class.
C# is a collection that you can package your class into a namespace called the namespace class. And you can help arrange collection of class on logical aggregations. When you started learning C#, it was clear that all namespaces were related to type systems. Microsoft also cho to include channels that assist in the compatibility of previous
code and APIs. The class are also included in Microsoft's namespace.
Type of data
C# lets you work with two types of data: value types and reference types. The value type holds the actual value. The reference type saves the actual value stored elwhere in the memory. Raw data types, such as character, integer, float, enumeration, and structure types, are all value types. Objects and array types are treated as reference types. C# predefines reference types (objects and strings) New, Byte, Unsigned Short, Unsigned Integer, Unsigned Long, Float, Double-Float, Boolean, Character, and The value type and reference type of the decimal type will eventually be executed by a primitive type object. C# also allows you to convert a value or a type to another value or a type. Y ou can u an implicit conversion strategy or an explicit conversion strategy. Implicit conversion strategies are always successful and do not lo any information (for example, you can convert an integer to a long integer without losing any information becau long integers are longer than integers) Some data is lost becau long integers can hold more value than integers. Conversion occurs.
结构体排序Before and after reference
Refer to Chapter 3 "Working with V ariables" to find out more about explicit and implicit conversion strategies.
Y ou can u single-dimensional and multidimensional arrays in C#