What is the advantage of using an Enum class to compare something. What is the disadvantage of :
public static final String TRUE = "true";
public static final String FALSE = "false";
public void method1(){
if(TRUE.equals(inputString)){
//do some logic
}
else if(FALSE.equals(inputString)){
//do some other logic
}
}
Why is it recommended to use Enum instead of String in the example?