You are viewing a single comment's thread. Return to all comments →
You can simply print out the error message using System.out.println("errorMessage");,
But for better learning try-catch is good practice.
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Java Static Initializer Block
You are viewing a single comment's thread. Return to all comments →
You can simply print out the error message using System.out.println("errorMessage");,
But for better learning try-catch is good practice.