Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the fully qualified name of C#

Shulou Source: shulou.com Published: 2022-06-02 09:07:55 09月30日 Update

This article mainly introduces "what is the fully qualified name of C#". In the daily operation, I believe that many people have doubts about what the fully qualified name of C# is. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the question of "what is the fully qualified name of C#"! Next, please follow the editor to study!

C # fully qualified name

As with Java, by providing the C # fully qualified name of the class (such as System.Data.DataSet or AcmeAccounting.GetDetails in the example above), we can access classes in .NET or user-defined namespaces without a using reference in the namespace.

The C # fully qualified name may become too long to use, in which case we can use the using keyword to specify an abbreviation or alias to improve the readability of the code.

In the following code, an alias is created to refer to code written by a fictional company:

Using DataTier = Acme.SQLCode.Client; using System; public class OutputSales {public static void Main () {int sales = DataTier.GetSales ("January"); Console.WriteLine ("January's Sales: {0}", sales);}}

Notice the syntax of WriteLine (), with {x} in the format string, where x represents the position of the parameter list of the values to be inserted here. Assuming that the GetSales () method returns 500, the output of the application will be:

January's Sales: 500

C # preprocessing instruction

Similar to C and C++, C # includes preprocessor instructions, which provide the ability to conditionally skip parts of the source file, report error and warning conditions, and describe different parts of the source code. The term "preprocessing instruction" is used only to be consistent with the C and C++ programming languages, because C # does not include separate preprocessing steps.

At this point, the study of "what is the fully qualified name of C#" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Caching preprocessing instructions learning code aliases situations methods more conditions spaces parts facets Clearing help different practical similar consistent next Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Linux Shulou Tech Info Redmi Shulou Information