Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Use of 'var' in C#
Message
De
30/04/2010 17:18:00
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01462533
Message ID:
01462596
Vues:
72
>What's the benefit of
>
>
>var customer = new Customer();
>
>
>as opposed to
>
>
>Customer customer = new Customer();
>
Most of the time the type can be inferred from the right side. In those cases var is a keyword meaning the inferred type. One big advantage is that if sometimes you are unsure about the type (but it can be inferred) then you use "var" then hover your cursor on var to see the inferred type. You are free to type the type yourself or let it be inferred.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform