0

I'm trying to write a compareTo method that compares the variable month of two objects. However when writing the method, it says "cannot find symbol" in respone to trying to compare the value of month between objects.

public class Appointment implements Comparable{

String month;
    
public void setMonth(String Input){
    month = Input;
}

public int compareTo(Object obj){
    int compare = 0;
    
    if (month == obj.month)... //month here says "cannot find symbol"
    
    return compare;
}

0 Answers0