DEV Community

Discussion on: Effective Java! Use EnumSet Instead of Bit Fields

Collapse
 
ojuniorbezerra profile image
ojuniorbezerra

Hi, I tried to execute this code:
EnumSet.of(Style.BOLD | Style.UNDERLINE)

I received this error:
"The operator | is undefined for the argument type(s)"

I'm using Java 8.

Collapse
 
kylec32 profile image
Kyle Carter

Sorry about that, that was a copy and paste error. Should be a "," not a "|" between those two arguments. Thanks for catching that.