Don't know why it prints infnite second array.Code is beautiful
package com.codegym.task.task07.task0705;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/*
One large array and two small ones
*/
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int[] array = new int[20];
for(int i = 0 ; i <20 ; i ++){
array[i] = Integer.parseInt(reader.readLine());
}
int[] largerarray = new int[10];
int[] smallerarray = new int[10];
for(int i = 0 ; i <10 ; i ++){
largerarray[i] = array[i];
}
for(int j = 0 ; j <10 ; j++){
for(int i = 10 ; i < 20 ; i ++){
smallerarray[j] = array[i];
if(j < 10)
System.out.println(smallerarray[j]);
}
}
}
}