Hi,
I dont understand why the 2nd last condition is failing. Could anyone please clarify the meaning of this condition.
I also tried adding to the list in the reverse order. But still, it is failing
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
ArrayList<String> list = new ArrayList<String>();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
for (int i = 0; i < 10; i++)
{
list.add(bufferedReader.readLine()) ;
}
for (int j = (list.size() - 1) ; j >= 0; j --)
{
System.out.println(list.get(j));
}
}
}