Re:How to Use Go Interfaces
by meddlepal on Tuesday March 20, 2018 @05:55AM
(#16627139)
You don't have to do this in Java anymore... Structural typing was added in Java 8 and is how method references are generally used. For example I use this often to avoid implementing Runnable when I already have a method satisfying the `void run()` contract on an existing implemented but with different name.
Edit: on reflection this may actually be duck typing not structural typing.
Edit: on reflection this may actually be duck typing not structural typing.