// Collection of code snippets by Arne Vajhøj // (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) using System; public class Dyn { public static void Main(String[] args) { dynamic o1 = 123; dynamic o2 = "ABC"; o1 = 123.456; // allowed to ref to another type string s1x = o1.Substring(1); // allowed to use methods not in actual type (but will generate runtime execption !) string s2x = o2.Substring(1); // allowed to use methods in actual type } }