Java Stdin and Stdout II

  • + 1 comment

    Because you cant do the input of a string after getting an integer.so when you try the input of an integer then you hit the 'Enter' then this enter will move to the variable as a string input. And you will not be able to get the input of the Actual String input. thats why there is " scan.nextLine(); ". Hope you understand! All the very best and enjoy programming.