Friday, July 13, 2018

How do you use a dynamic type in a console project?

Type 'dynamic' are used to bypass the compile time type checking and are resolved at run time. You can use 'dynamic' to specify a dynamic variable.


In the following C# Console Project, a dynamic variable is defined which is initially of type 'string' and later in the program is assigned to a integer type.


Once defined d remains dynamic as shown here:

The above program complies and here is result:







No comments: