0
votes
1answer
32 views

Invoking default methods from lambdas

Is there a way to invoke a default method when defining lambda? E.g. @FunctionalInterface public interface StringCombiner { String combine(String s1, String s2); default String bar(String ...
4
votes
1answer
375 views

Is there delegate in Java 8 (JDK8)?

Is there delegate in Java 8 ? If No , How we have lambda expressions in JDK 8 without delegates ? What is Method References ? Is this the same as delegate? Method References Thanks
1
vote
3answers
223 views

Will closures in Java 8 enable factory methods using constructor pointers?

My least favorite aspect of the Factory method pattern is the almost unavoidable necessity of lengthy if/then or case statements. If you have many classes to resolve, it becomes even worse. I just ...
1
vote
2answers
286 views

Pseudo first class functions in Java?

Below I have a rough implementation of testing a list lambda functions on an integer in Python. I know Java currently doesn't support closures or lambdas (yet), but I'm curious, is this remotely ...
12
votes
2answers
471 views

JDK8 lambdas to begin with conceived as no true closures? [closed]

I had a look at JDK8 lambdas recently and discovered that the old problem with variables handed over from the outer context into an anonymous class still exists with JDK8 lambdas (the var then has to ...
104
votes
7answers
20k views

Java 8 and Scala

This Java 8 vs Scala: a Feature Comparison article on InfoQ, very well summarizes the similarities between the upcoming Java 8 and Scala. Given the improvements to Java 8, what are the features in ...
1
vote
1answer
401 views

Lambdaj: Loop through Map and get the values and put in other Map

I'm new to lambdaj so trying to get more used to it. I want to update this code using lambdaj: Passed in parameter Map<String, Device> devices; final Map<String, String> resultHash = ...