Skip to content

Instantly share code, notes, and snippets.

@peas
Created January 5, 2014 12:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peas/8267900 to your computer and use it in GitHub Desktop.
Save peas/8267900 to your computer and use it in GitHub Desktop.
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