I am using BufferedReader class to read inputs in my Java program.
I want to read inputs from a user who can enter multiple integer data in single line with space.
I want to rea
int a[] = new int[n];
String line = br.readLine(); // to read multiple integers line
String[] strs = line.trim().split("\\s+");
for (int i = 0; i < n; i++) {
a[i] = Integer.parseInt(strs[i]);
}