sentence: for example , if a third party java library implements a class you are not allowed to modify , you can not use an instance of the class in place of an interface you have defined yourself , whereas duck typing would allow this .