All Questions
5 questions
8
votes
0
answers
822
views
What lambda function optimizations, if any, are planned for Java 9 and beyond? [closed]
I'm working on a high-performance project where Java 8's lambda functions are enormously useful. I've found, however, that they're memory inefficient when used en masse. For example, suppose I need to ...
0
votes
1
answer
85
views
How confusing is `new SomeCollection(values...)::contains` as a Predicate? [closed]
Traditionally, a function that want to skip certain items during processing will accept a Collection or var-args argument, but in the Java 8 world I think I should switch to Predicates.
Now, since ...
50
votes
4
answers
22k
views
Why should I use "functional operations" instead of a for loop?
for (Canvas canvas : list) {
}
NetBeans suggests me to use "functional operations":
list.stream().forEach((canvas) -> {
});
But why is this preferred? If anything, it is harder to read and ...
71
votes
3
answers
34k
views
Is there a performance benefit to using the method reference syntax instead of lambda syntax in Java 8?
Do method references skip the overhead of the lambda wrapper? Might they in the future?
According to the Java Tutorial on Method References:
Sometimes... a lambda expression does nothing but call an ...
31
votes
1
answer
17k
views
Type inference in Java 8
Is the introduction of the new lambda notation (see e.g. this article) in Java 8 going to require some kind of type inference?
If so, how will the new type system impact the Java language as a whole?