Getting more confused as the the task are extremely hard to get right. I keep failing the test even though the output is correct. Is this on purpose or am I going too fast through the lessons? Anybody cares to share his/her experiences?
package com.codegym.task.task07.task0719;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
/*
Display numbers in reverse order
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
//write your code here
ArrayList<Integer> numbers = new ArrayList<Integer>();
for (int i = 0; i < 10; i++){
String s = reader.readLine();
int t = Integer.parseInt(s);
numbers.add(0, t);// adds the numbers not at the end but beginning so it gives a reversed order
}
System.out.println(numbers);
}
}