Well, actually my confusion lies in the following piece of code:
public static void main(String args)
Scanner sc=new Scanner(System.in);
System.out.println("Enter the first number: ");
System.out.println("Enter the second number: ");
When the first message "Enter the first number" is displayed, and then if I input both the values for a and b at once, on the same line
and then press ENTER, both are read. But after second message "
Enter the second number" is dispalyed, it does not take anymore input and directly prints the values of a and b, although there is a call to the next() function after the second message.
This is what I can't get, why is the next() function not called a second time?