Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Dynamics

using System.IO;
using System;
using static System.Console;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Dynamics
{
    class Program
    {
        static void Main(string[] args)
        {
            object obj = "foo";
            // obj.GetHashCode();
            
            // using reflection
            MethodInfo methodInfo = obj.GetType().GetMethod("GetHashCode");
            methodInfo.Invoke(null, null);
            
            // with reflection
            // object excelObject = "SomeExcelObject";
            // excelObject.Optimize();
            
            // using dynamic
            // dynamic excelObject = "SomeExcelObject";
            // excelObject.Optimize();
            
            //dynamic name = "Foo";
            //name++;
            
            dynamic x = 10;
            dynamic y = 20;
            var z = x + y;
            
            int a = 5;
            dynamic b = a;
            
            long l = b;
            
        }
    }
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.