Can anyone explain why it still doesn't accept my answer?
When i run the application locally it does what i expected.
Thanks!
package com.codegym.task.task07.task0710;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
/*
To the top of the list
*/
public class Solution {
public static void main(String[] args) throws Exception {
ArrayList<String> strings = new ArrayList<String>() {
{
for (int i = 0; i < 10; i++) {
add("");
}
}
};
for (int i = strings.size() -1; i >= 0; i--) {
Scanner scanner = new Scanner(System.in);
String s = scanner.nextLine();
strings.set(i, s);
}
for (String s : strings) {
System.out.println(s);
}
}
}