Search:

Type: Posts; User: helloworld922

Search: Search took 0.14 seconds.

  1. Re: boolean value in a simple loop (do-while)

    If you don't want it to "over count" use a while loop:


    while(continue())
    {
    loopCount++;
    System.out.println("Enter a number: ");
    if (Scanner.nextInt() < 0)
    {
    ...
  2. Re: boolean value in a simple loop (do-while)

    You're calling the method continue twice. Each time, it will ask the user if you want to continue. What you should do is only call it once, and store the result of that call in a variable so you can...
Results 1 to 2 of 2