2
Reply

What is Implicit typed variable (var) in c#?

Satheesh Kumar Pilli

Satheesh Kumar Pilli

Aug 20, 2014
1.3k
0

    initialize variable at compile time eg: var x = 100;

    Mahesh Kumar alanka
    September 18, 2014
    0

    Implicit typed variable type (var), this feature has been added from c# 3.0 which allows to declare a variable using "var" keyword. The type of the variable is identified at the time of its compilation depending upon the value assigned to it.Eg-var a=99; // a is int type (at compile time) var s="Hi"; // s is string type(at compile time) var f=1.23 ; // f is float type(at compile time)

    Satheesh Kumar Pilli
    August 20, 2014
    0