why the error?
package com.codegym.task.task07.task0711;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
/*
Remove and insert
Declare a string list variable and immediately initialize it.
2. The program should read 5 strings from the keyboard.
3. Remove the last string and insert it at the beginning. Rinse and repeat 13 times.
4. The program should display the list, each value on a new line.
*/
public class Solution {
public static void main(String[] args) throws Exception {
//write your code here
ArrayList<String> strings = new ArrayList<String>();
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
for (int i=0;i<5;i++)
{
String s= in.readLine();
strings.add(s);
}
for (int j=0;j<13;j++)
{
String temp=strings.get(4);
strings.add(0,temp);
strings.remove(4);
}
for (int k=0;k<5;k++)
{
System.out.println(strings.get(k));
}
}
}