How to declare implicit strong type variable that the compiler determines the type in C#

1 Answer

0 votes
using System;

class Program
{
    static void Main() {
        var x = 12; // Implicit type
        
        int y = 10; // Explicit type

        Console.Write("{0} {1}", x, y);
    }
}



/*
run:

12 10

*/

 



answered Nov 22, 2020 by avibootz

Related questions

1 answer 250 views
1 answer 302 views
1 answer 240 views
1 answer 220 views
1 answer 183 views
1 answer 269 views
269 views asked Jul 6, 2018 by avibootz
...