I'm getting 13 arrays printed out, with everytime the last index in the first spot, so very happy with that. But HOW do I print every value of every array on a separate line?
By the way, I've tried System.out.println(list.get(0) too, but that doesn't work either...
package com.codegym.task.task07.task0711;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
/*
Remove and insert
*/
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<String> list = new ArrayList<String>();
for (int i = 0; i < 5; i++) {
String s = reader.readLine();
list.add(s);
}
for (int i = 0; i < 13; i++) {
list.add(0, list.remove(4));
System.out.println(list);
}
}
}