Can an enum have abstract methods? If so, what is the use, and give a scenario which will illustrate this usage.
Yes, you can define abstract methods in an enum declaration if and only if all enum values have custom class bodies with implementations of those methods (i.e. no concrete enum value may be lacking an implementation).
public enum Foo {
BAR {
public void frobnicate() {
// do BAR stuff
}
},
BAZ {
public void frobnicate() {
// do BAZ stuff
}
};
public abstract void frobnicate();
}