What results when you pass an invalid String to a Java enum .valueOf call?

You should get an IllegalArgumentException if the name is not that of an enum (which it wont be for the empty string). This is generated in the API docs for all enum valueOf methods. You should get a NullPointerException for null. It’s probably not a good idea to give a dummy value to your String variable (nor to allow the last case/default to fall through).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)