Error Compiling Example from Documentation

Felix Schmidt schmidtfx at googlemail.com
Tue Dec 7 04:16:47 PST 2010


Everybody,

I tried to compile this example from the documentation:


|class Person {
     private final String name;
     private final int age;

     public static int compareByAge(Person a, Person b) { return a.name.compareTo(b.name) }

     public static int compareByName(Person a, Person b) { return a - b; }
}

Person[] people = ... // replaced by something
Arrays.sort(people, #Person.compareByAge);


The javac (lambda included) compiler reports me: lambda/Main.java:[46,29] '{' expected

Is this feature not yet implemented? How could I get this compiled?

- Felix

|




More information about the lambda-dev mailing list