Tabela typów wbudowanych (C# odwołanie)Built-in types table (C# Reference)
W poniższej tabeli przedstawiono słowa kluczowe dla C# typów wbudowanych, które są aliasami wstępnie zdefiniowanych typów w przestrzeni nazw System:The following table shows the keywords for built-in C# types, which are aliases of predefined types in the System namespace:
UwagiRemarks
Wszystkie typy w tabeli, z wyjątkiem object
i string
, są określane jako typy proste.All of the types in the table, except object
and string
, are referred to as simple types.
Typy .NET i ich C# aliasy słów kluczowych są zamienne.The .NET types and their C# type keyword aliases are interchangeable. Na przykład można zadeklarować zmienną całkowitą przy użyciu jednej z następujących deklaracji:For example, you can declare an integer variable by using either of the following declarations:
int x = 123;
System.Int32 y = 123;
Użyj operatora typeof , aby pobrać wystąpienie System.Type reprezentujące określony typ:Use the typeof operator to get the System.Type instance that represents the specified type:
Type stringType = typeof(string);
Console.WriteLine(stringType.FullName);
Type doubleType = typeof(System.Double);
Console.WriteLine(doubleType.FullName);
// Output:
// System.String
// System.Double
Zobacz takżeSee also
Opinia
Trwa ładowanie opinii...