Skip to content

Instantly share code, notes, and snippets.

@peas
Created Jan 5, 2014
Embed
What would you like to do?
javac br/com/casadocodigo/java8/Capitulo5.java
br/com/casadocodigo/java8/Capitulo5.java:44: error: variable comparator is already defined in method main(String[])
Comparator<Usuario> comparator =
^
br/com/casadocodigo/java8/Capitulo5.java:58: error: cannot find symbol
.thenComparing(s -> s.length());
^
symbol: method length()
location: variable s of type Object
br/com/casadocodigo/java8/Capitulo5.java:58: error: incompatible types: no instance(s) of type variable(s) U exist so that Comparator<Object> conforms to Comparator<String>
.thenComparing(s -> s.length());
^
where U,T are type-variables:
U extends Comparable<? super U> declared in method <U>thenComparing(Function<? super T,? extends U>)
T extends Object declared in interface Comparator
3 errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment