import java.io.BufferedReader; code example
Example 1: bufferedreader in java
class Main {
public static void main (String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] str = br.readLine().split(" ");
String[] input = br.readLine().split(" ");
int n = Integer.parseInt(str[0]);
int k = Integer.parseInt(str[1]);
int [] arr = new int [n];
for(int i=0; i<n; i++)
{
arr[i] = Integer.parseInt(input[i]);
}
}
}
Example 2: declare bufferedreader java
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));