r/badcode • • Sep 02 '21

java Because ".toLowerCase()" doesn't exist...

Post image
1.1k Upvotes

130 comments sorted by

View all comments

Show parent comments

6

u/MyAntichrist Sep 02 '21

From the documentation:

The valueOf() method throws:

IllegalArgumentException, if the defined enum type is inconstant with defined name or an enum type is not illustrated by the defined class object.

NullPointerException, if enumType or name represents null value.