Search:

Type: Posts; User: helloworld922

Search: Search took 0.10 seconds.

  1. Re: Weird issue with while loop ending/being skipped

    That's not true... It's possible to trick the compiler:


    boolean a = true;
    while (a)
    {
    System.out.println("Infinite loop!");
    }
    System.out.println("I tricked the compiler! This...
  2. Re: Weird issue with while loop ending/being skipped

    The reason is that the .nextDouble(), .nextInt(), etc. methods don't consume the new-line character. The user will type something like this:

    "123\n" (\n comes from user hitting the return/enter...
Results 1 to 2 of 2