// 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 Obj { public static void Main(String[] args) { object o1 = 123; object o2 = "ABC"; o1 = 123.456; // allowed to ref to another type string s1x = o1.Substring(1); // not allowed to use methods not in object string s2x = o2.Substring(1); // not allowed to use methods not in object } }