![](https://secure.gravatar.com/avatar/326b108ffcc42f27628703b0c11ed239.jpg?s=120&d=mm&r=g)
6 Feb
2021
6 Feb
'21
8:44 p.m.
On Sat, 6 Feb 2021 at 20:07, Rudi Araújo <rudi.araujo@gmail.com> wrote:
Class::newInstance() doesn't have any parameters (also, it's deprecated: better to use getConstructor() or getDeclaredConstructor() and call newInstance() on it).
I guess this bit about getConstructor() explains why it'd be more convenient to use a Factory, or the Factory method pattern, or some dependency injection framework.
Also, the generic agreement on your calls to makeAndPrint is failing.
Ah, <? extends Foo> was the key bit I was missing, thanks. :-) On Sat, 6 Feb 2021 at 20:25, Rudi Araújo <rudi.araujo@gmail.com> wrote:
The Stream API and lambdas make it almost pleasant to work with Java, but exception handling is still a bit tricky...
Yes, yes, almost. 🙄 Luís