Jon Swanson wrote:There is a class, which I cannot modify, that contains methods that are overloaded. The behavior of the method depends on the enum that is passed to the method. I cannot move these methods into the enum, they rely on a lot of data structures and other methods of the class they are currently in.
Paul Clapham wrote:That code you posted, couldn't you just replace it by a call to Enum.valueOf()?
Why not use an array initialiser?I think you have to give a name to the array before it will compile. There is something iffy about non‑private fields, particularly those whose type is some sort of array.
Jon Swanson wrote:. . . . . .