use dynamic type
Published: 14. October 2011 | Updated: 26. October 2011License: Microsoft Public License (MS-PL)
Categories: Framework » Types
Tags: C#
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[]
145
System.Int32[]
| Send us feedback about this snippet » |





