« Csharp 12 » : différence entre les versions
De Banane Atomic
Aller à la navigationAller à la recherche
(Page créée avec « Category:CSharp = Links = * [https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-12 What's new in C# 12] ») |
Aucun résumé des modifications |
||
Ligne 2 : | Ligne 2 : | ||
= Links = | = Links = | ||
* [https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-12 What's new in C# 12] | * [https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-12 What's new in C# 12] | ||
= [https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/tutorials/primary-constructors Primary constructors] = | |||
<kode lang='cs'> | |||
public class Item | |||
{ | |||
private string name; | |||
} | |||
// equivalent with a primary constructor | |||
public class Item(string name) | |||
{ } | |||
</kode> |
Version du 3 mai 2024 à 07:54
Links
Primary constructors
public class Item { private string name; } // equivalent with a primary constructor public class Item(string name) { } |