Given:
and this code fragment:
What is the outcome?
valueOf("CMO") resolves to the enum constant CMO because enum lookup requires the exact declared constant name. The switch therefore selects case CMO and prints Marketing. The unused stream pipeline does not print anything. Java Enum API
valueOf("CMO")
CMO
case CMO
Marketing
Community Discussion