Here’s a great way to do Duck Typing in Java. I’m using the same technique in some software that I’m currently writing.

This is exactly what Duck Typing allows us to do—to implement an interface at runtime. So all that remains is to figure out a way to implement this in Java…

Link



Related Leave a Comment