Here you can find the source of readArr(Scanner in, int n)
public static int[] readArr(Scanner in, int n)
//package com.java2s; //License from project: Open Source License import java.util.Scanner; public class Main { public static int[] readArr(Scanner in, int n) { int[] ar = new int[n]; for (int i = 0; n - i != 0; i++) { ar[i] = in.nextInt();/* w ww .ja v a 2 s. c om*/ } return ar; } }