X1158: validUserName

The following code runs a method called validateUser() that will throw an IllegalArgumentException if a username (passed in as a parameter) is less than three letters long. This method will not return any value and will do nothing if no error is thrown.

Below, a try/catch block has been implemented to make the username longer than 3 characters if it is too short.

Add in a finally block to add ".user" onto the end of each user name.

Your Answer:

Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.