Lightweight interfaces instead of function types
Mark Thornton
mthornton at optrak.co.uk
Sun Feb 21 04:10:38 PST 2010
Stephen Colebourne wrote:
> I'm not trying to start a debate on this - its partly philosophical.
> But I do feel its very important to make the point that, IMO, most
> developers don't worry about these things to the extent that language
> designers do. Writing Callable<String>[] array = new Callable[10]; has
> become just a necessary part of using Java today.
>
>
Common yes, necessary no. Leaving the LHS as Callable[] is safe, but
requires more casts. The varargs case isn't equivalent because were
generics to be reified it would be fixed in one place (the compiler).
Mark
More information about the lambda-dev
mailing list