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 163 views
1 answer 197 views
1 answer 154 views
1 answer 95 views
1 answer 95 views
1 answer 189 views
189 views asked Jul 6, 2018 by avibootz
...