package com.codegym.task.task09.task0921; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; import java.io.*; /* Method in a try-catch */ public class Solution { public static void main(String[] args) { readData(); } public static void readData() throws Exception { //write your code here BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); ArrayList<Integer> al=new ArrayList<Integer>(); try{ al.add((Integer.parseInt(br.readLine()))); } catch (NumberFormatException ex){ ex.printStackTrace(); for(int i=0;i<al.size();i++) System.out.println(al.get(i)); } } }