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 178 views
1 answer 221 views
1 answer 170 views
1 answer 110 views
1 answer 103 views
1 answer 200 views
200 views asked Jul 6, 2018 by avibootz
...