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