|
|
|
|
|
by Niten
5055 days ago
|
|
> 3. You can't do closures in Java. You can. It's just incredibly verbose. It looks like you're confusing closures with lambda expressions. That's an example of (a more verbose functional equivalent of) a lambda expression, but it isn't a closure. Java's anonymous inner classes can close over variables in enclosing classes, but they can capture only final variables directly from the enclosing lexical scope. So Java actually does not support true closures. |
|