Interesting. You may have found an error in the specification. I get the same problem, and I don't think it's just down to the version of Java you're using (though it's possible).
Here's how I see what's going on. When you define a constant-specific class body like this, what I think is going on behind the scenes is that you're effectively creating a subclass of Operation. Then the constant is an instance of that subclass. But you're referencing it as if it was just a plain Operation, and eval doesn't exist in the Operation class.
But you can get it to compile, and work in the way they're intending, by adding the following line to the Operation classbody:
It ought to be abstract because if you provide a default implementation you don't force each constant to implement eval itself. And this breaks part of the point of the pattern - as the spec says:
...the pattern precludes the possibility of forgetting to add a behavior for a new constant (you'd get a compile-time error)
Which can be confirmed by adding a new constant (say POWER_OF) and not providing an implementation of eval. If the method is abstract then there's a compiler error. (I wasn't 100% sure this would work without marking the enum as abstract, but it does).
The spec also says
The above pattern is suitable for moderately sophisticated programmers
, so perhaps Beginning Java isn't the best place for this!
Oh, and welcome to JavaRanch . By the way, adding Code Tags would make your post much easier to read.