Modified Main.java

Surrounded the calls to the tryGetMax and tryRemove methods in
try…catch blocks to grab the exception and print it to the console.