You are viewing a single comment's thread. Return to all comments →
But why use try-catch?
I don't think you have to. I just did it this way since they insinutated at it with "java.lang.exception" in their desired string.
You can simply print out the error message using System.out.println("errorMessage");,
But for better learning try-catch is good practice.