Assume that command is a variable of type String. Write a statement that throws an Exception with a message “null command” if command is null and that throws an Exception with a message “empty command” if command equals the empty string.

Assume that command is a variable of type String. Write a statement that throws an Exception with a message “null command” if command is null and that throws an Exception with a message “empty command” if command equals the empty string.

LANGUAGE: JAVA

CHALLENGE:

Assume that command is a variable of type String. Write a statement that throws an Exception with a message “null command” if command is null and that throws an Exception with a message “empty command” if command equals the empty string.

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days – Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level