e.g Let C be a classnow suppose the object to be realistic in real world and the objects of class that implements Imarker interface are always intelligent entities.
C1 and C2 inherits C and also C2 implements Imarker interface.
now let 5 objects of C1 and 3 objects of C2 go for competition and clearly objects of C2 are winner. Then to check which object is winner which is not, instead of checking property of individual we just will check which is object is assignable to reference of Imarker interface. which removes lot of checks in case of complex scenarios.
No comments:
Post a Comment