Assume that e is a variable of type Exception that has been declared and that references an Exception object. Assume that msg is a variable of type String. Write a statement that assigns to msg the message associated with e.

Assume that e is a variable of type Exception that has been declared and that references an Exception object. Assume that msg is a variable of type String. Write a statement that assigns to msg the message associated with e.

LANGUAGE: JAVA

CHALLENGE:

Assume that e is a variable of type Exception that has been declared and that references an Exception object. Assume that msg is a variable of type String. Write a statement that assigns to msg the message associated with e.

SOLUTION:

msg = e.getMessage();

Add comment