Should I change the for loop to start from10 and go to 0? I am not sure why it stating the last two are wrong?
package com.codegym.task.task07.task0710;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
/*
To the top of the list
*/
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 < 10; i++)
{
String s = reader.readLine();
list.add(s);
System.out.println(s);
}
}
}