3 ms·
The only thing I wish Java had is closures, but they are actually under consideration for a future Java release! Right now you can get similar behavior with an
by edgeztv 20y ago
The only thing I wish Java had is closures, but they are actually under consideration for a future Java release!
Right now you can get similar behavior with anonymous inner classes, but it leads to more clutter than necessary.
This demonstrates another good argument in favor of java - it is always evolving to make programming in it more enjoyable. It was difficult to use collection classes at first, but version 1.5 introduced generics. It sucked to use the iterator pattern with collections, but now java has a "for each" loop. It sucked not having enums, but now Java has them too, etc. Not to mention that every new Java release brings a ton of new library classes and enhancements.