/* 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 whne 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 Driverv1 { public static void main (String [] args) { Xv1 x = new Xv1(10); Xv1 x2; Yv1 y = new Yv1(5); x2 = x; // OK, both of the same type x2 = y; // Not OK, not of the same type } }