• + 0 comments

    Practicing mapping:

            //java8
            ArrayList<Integer> A = new ArrayList<>();
            while (scan.hasNextInt())A.add(scan.nextInt());
            int[] a = A.stream().mapToInt(i -> i).toArray();