I am making a program and am using user input. When I am getting a String I have always used .nextLine(), but I have also used .next() and it does the same thing. What is the difference?
Scanner input = new Scanner(System.in);
String h = input.nextLine();
String n = input.next();
What is the difference?