3 ms·
Right, I was thinking that this is the answer to the supposedly intractable problem posed by the original article. Just make your ExampleInterface generic -- E
by iainmerrick 3y ago
Right, I was thinking that this is the answer to the supposedly intractable problem posed by the original article.
Just make your ExampleInterface generic -- ExampleInterface<T>.foo() throws T.
That technique works really well, and I don’t understand why it isn’t more widely used (or at least it wasn’t when I last used Java for serious work).