use of try-with-resource instead of standard try-catch, added hashcode
in Pokemon