Here's what I've written:
public class JavaApplication4 {
private RunMode runMode;
private enum RunMode {
STOP, START, SCE, SIE;
void reset() {
this = STOP; // <=== 'cannot assign a value to final variable this.'
}
}
}
As noted, the assignment to 'this' is flagged. Why is 'this' final, and how can I change the value of an enum variable with an enum instance method?