Just learning Java and have came over type substitution, can any one explain how this works and why you would use it?