Logo

Programming-Idioms

History of Idiom 94 > diff from v19 to v20

Edit summary for version 20 by programming-idioms.org:
[Csharp] Stick to statement

Version 19

2016-04-08, 06:27:57

Version 20

2016-10-26, 12:09:01

Idiom #94 Print type of variable

Print the name of the type of x. Explain if it is a static type or dynamic type.

This may not make sense in all languages.

Idiom #94 Print type of variable

Print the name of the type of x. Explain if it is a static type or dynamic type.

This may not make sense in all languages.

Code
object variable1 = new DateTime(2015,3,10);

System.Console.WriteLine(variable1.GetType());
Code
System.Console.WriteLine(x.GetType());