Main.java:19: error: no interface expected here
public static class EmpComparator extends Comparator<Employee>{
^
Main.java:27: error: bad operand types for binary operator '>'
else if(o1.name>o2.name)
^
first type: String
second type: String
Main.java:45: error: no suitable method found for sort(Set<Employee>,EmpComparator)
Collections.sort(hash,new EmpComparator());
^
method Collections.<T#1>sort(List<T#1>) is not applicable
(cannot infer type-variable(s) T#1
(actual and formal argument lists differ in length))
method Collections.<T#2>sort(List<T#2>,Comparator<? super T#2>) is not applicable
(cannot infer type-variable(s) T#2
(argument mismatch; Set<Employee> cannot be converted to List<T#2>))
where T#1,T#2 are type-variables:
T#1 extends Comparable<? super T#1> declared in method <T#1>sort(List<T#1>)
T#2 extends Object declared in method <T#2>sort(List<T#2>,Comparator<? super T#2>)
Main.java:47: error: cannot find symbol
while(it.hashNext()){
^
symbol: method hashNext()
location: variable it of type Iterator
Main.java:48: error: incompatible types: Object cannot be converted to Employee
Employee e=it.next();
^
5 errors