C# 4.0 supports dynamic programming by introducing new dynamic typed objects. The type of these objects is resolved at run-time instead of at compile-time. The keyword tells the compiler that everything to do with the object, declared as dynamic, should be done dynamically at the run-time using Dynamic Language Runtime(DLR)
dynamic num = Getnum();
dynamic str = GetString();
Console.WriteLine("Your number is " + num);
Console.WriteLine("Your string is " + str);
Console.Read();
private static string GetString()
{
return "Welcome";
}
private static int Getnum()
return 1;
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: