if you want to set the variable at runtime go with dynamic
if you want to set the variable at compile time go with var
e.g in dynamic
void Main()
{
var k = exampleMethod("23");
Console.WriteLine(k);
}
public static dynamic exampleMethod(dynamic d)
{
dynamic local ="string";
int i =3;
if(d is string )
return local;
else
return i;
}
No comments:
Post a Comment