Re: How does it know?
On Fri, 12 Sep 2014 21:40:38 +0300, Donkey Hottie wrote:
12.09.2014, 19:36, Steven Simpson kirjoitti:
On 12/09/14 16:36, Knute Johnson wrote:
On 9/12/2014 08:11, Knute Johnson wrote:
The second question is, what type is test.main()? I want to be able to
put it into a Map.
Now that I think about it, I don't think that is possible.
import java.util.*;
public class TestApplication {
public interface Application {
void main(String... args) throws Exception;
}
public static void main(String[] args) {
Map<String, Application> map = new HashMap<>();
map.put("self", TestApplication::main);
}
}
That does not compute. Or is this some Java 8 new feature? I thought
methods are not "first class citizens" in Java...
Yes, that is part of the new Java 8 changes surrounding the Lambdas.
Liebe Gruesse,
Joerg
--
Ich lese meine Emails nicht, replies to Email bleiben also leider
ungelesen.