почему для проверки на SHORT именно Integer.parseInt(), a не Short.parseShort() ?? if (Integer.parseInt(str) > 0 && Integer.parseInt(str) < 128){ print(Short.parseShort(str)); }else{ print(Integer.parseInt(str)); }