/* An example from Java: A beginners's guide by Herbert Schildt that illustrates the the strongly typed nature of Java. A reference for one type of object cannot normally refer to another type of object except when a reference of a superclass is referred to an object that's a subclass. v1 - won't compile. v2 - uses inheritance and will compile */ public class Xv2 { private int a; public Xv2 (int i) { a = i; } public int getA () { return a; } public void setA (int n) { a = n; } }