System.out.println("A's version of getAttr returns: " + new A().getAttr()); System.out.println("B's version of getAttr returns: " + new B().getAttr());  A c = new B();
System.out.println("OA's version of getAttr returns: " + new OA().getAttr()); System.out.println("OB's version of getAttr returns: " + new OB().getAttr());  OA c = new OB();
	public static void main(String[] av) {		System.out.println("A's version of getAttr returns: " +			new A().getAttr());		System.out.println("B's version of getAttr returns: " +			new B().getAttr());		// Declared as A, instantiated as B, so gets B's version of things.		A c = new B();		System.out.println("C's version of getAttr returns: " +			c.getAttr());	}