Question 4
Back to Exercise
What does Size.valueOf("XL") do if there is no XL constant?
- A Returns null
- B Throws IllegalArgumentException Correct
- C Returns the first constant
- D Creates a new constant
Correct Answer: Option B
valueOf is also case-sensitive.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!