Добрый день, делал сегодня задачу и возник вопрос почему я вызываю метод print после исключения? (В последний метод print передается переменная типа String). public class Solution { public static void main(String[] args) throws IOException { String str; Scanner scan = new Scanner(System.in); while(true){ str = scan.nextLine(); if(str.equals("exit")){ break; } try{ if(str.contains(".")){ print(Double.parseDouble(str)); } else if((Integer.parseInt(str)<=0) || (Integer.parseInt(str)>=128)){ print(Integer.parseInt(str)); } else if((Short.parseShort(str)>0) && (Short.parseShort(str)<128)){ print(Short.parseShort(str)); } }catch(NumberFormatException e){ print(str); } } }