About 180,000 results
Open links in new tab
  1. wait - How do I make a delay in Java? - Stack Overflow

    If you want to pause then use java.util.concurrent.TimeUnit: TimeUnit.SECONDS.sleep(1); To sleep for one second or. TimeUnit.MINUTES.sleep(1); To sleep for a minute. As this is a loop, …

  2. time - Java Loop every minute - Stack Overflow

    Aug 30, 2013 · The ScheduledExecutorService interface is part of the java.util.concurrent package built into Java 5 and later as a more modern replacement for the old Timer class. …

  3. Java Main Game Loop - Stack Overflow

    Aug 17, 2013 · Overall, it is a good loop, but there are a few missing aspects to what I have found in experience to be the best loop. You will eventually want to move to LWJGL or some other …

  4. How to make for loops in Java increase by increments other than 1

    The "increment" portion of a loop statement has to change the value of the index variable to have any effect. The longhand form of "++j" is "j = j + 1". So, as other answers have said, the correct …

  5. Fastest way to iterate an Array in Java: loop variable vs enhanced …

    In Java, is it faster to iterate through an array the old-fashioned way, for (int i = 0; i < a.length; i++) f(a[i]); Or using the more concise form, for (Foo foo : a) f(foo); For an

  6. do-while to make a yes or no answer? java - Stack Overflow

    Feb 22, 2014 · You want to ask for the user's input BEFORE you start the loop again. This way, at the end of the loop, it asks the user if he/she wants to continue. If the answer is "yes", then the …

  7. java program to loop back to start - Stack Overflow

    Apr 22, 2014 · You could put everything into a while loop like this: boolean isRunning = true; String tryAgain = ""; while (isRunning) { // All your code you have in your example.

  8. java - Creating an Object inside a loop - Stack Overflow

    @SebastianH String a ="foo" here "foo" is a string literal and stored in java string pool. if you try to assign same literal into another reference, it will get same reference from string pool. but new …

  9. loops - Java Delay/Wait - Stack Overflow

    Dec 21, 2011 · How do I make a delay in a for loop in java?-1. Java Time Interval. Related. 7. Java - wait and notifyAll ...

  10. Re-prompt user after invalid input in Java - Stack Overflow

    Sep 10, 2013 · I'm writing this program in java where I need to re-prompt the user after an invalid input. I came to a solution only to discover that if the user enters another invalid input after the …