I know there are many questions to this problem on here but I did all those solutions and it still doesn't work. For some reason it only stores the first input
My Input:
1
2
3
4
Expected Output:
[1.0,2.0,3.0,4.0]
Actual Output:
[1.0]
Code
inputValue = stdin.readLine (); //Reads input
String [] input = inputValue.split ("\\R");
double [] numbers = new double[input.length];
for(int i = 0; i < input.length; i++){
numbers[i] = Double.parseDouble(input[i]);}
doubleand put it in the array directly. there is no need of extraStringvariable.