the method equalto assumes that the argument (declared of type personis also of type student and performs narrowing conversion from type person (an interfaceto type student ( classusing cast the conversion is allowed in this casebecause it is narrowing conversion from class to interface uwhere we have an object taken from such that extends (or sand implements code fragment interface person class student implementing because of the assumption above in the implementation of method equaltowe have to make sure that an application using objects of class student will not attempt the comparison of student objects with other types of objectsor otherwisethe cast in method equalto will fail for exampleif our application manages directory of student objects and uses no other types of person objectsthe assumption will be satisfied