I'm trying to write code that uses the Scanner class to get input from the user. But hasNext(), hasNextInt(), and hasNextLine() all run into infinite loops every time.
public static void getInput(ArrayList<Double> arr){
Scanner input = new Scanner(System.in);
String data = "";
String init;
while(input.hasNextLine()){
init = input.nextLine();
data += init;
}
.
.
.
}