How to

use dynamic type

Published: 14. October 2011 | Updated: 26. October 2011
License: Microsoft Public License (MS-PL)
Categories: Framework » Types
Tags: C#
Was this snippet helpful for you? YESYES / NONO
dynamic d = "test";
Console.WriteLine(d);
            
d = 145;
Console.WriteLine(d);

d = new [] { 15, 16 ,17 };
Console.WriteLine(d);
Console Output:
test
145
System.Int32[]
Send us feedback about this snippet »



Related Snippets: