Ah I see that now. I was thinking of the following situation:
import java.util.Scanner;
public class Main{
public static void main(String args[]) {
Scanner myscanner = new Scanner(System.in);
System.out.println("Enter a number and press enter:");
double one = myscanner.nextDouble();
System.out.println("Enter some text and press enter:");
String text = myscanner.nextLine();
System.out.println("The number you entered: " + one);
System.out.println("The text you entered: " + text);
}
}
The above program won't work correctly because the nextDouble() function doesn't scan past the newline character *after* the number.
However, your program works because nextDouble() does actually scan past the newline character *before* the number.
Anyway, glad you got it figured out.