I don't see anything that I am doing wrong, but NetBeans gives me the following error:
incomparable types
required: boolean
found: java.lang.Object
public int compareTo(Object obj) {
if( obj instaceof Employee){
Employee employee = (Employee) obj;
if(this.weekly_earnings > employee.weekly_earnings)
return 1;
else if(this.weekly_earnings == employee.weekly_earnings)
return 0;
else
return -1;
}
else{
System.out.println("Error");
}
}