Exemplo Thread Sleep
{"Image DocumentName": "Exemplo Thread Sleep", "Image ImageDescription": "public class ThreadSleep extends Thread { private long tempo = 0; public ThreadSleep(long tempo) { this.tempo = tempo; } // Construtor public void run() { // C\u00f3digo da Thread System.out.println(getName() + vai dormir por + tempo + ms. ); try { sleep(tempo); System.out.println(getName() + acordou. ); } catch (InterruptedException e) { e.printStackTrace(); } } public static void main(String args[]) { for (int i=0; i<10; i++) // Cria e executa as Threads new ThreadSleep((long)(Math.random() 10000)).start();", "Image XResolution": "37", "Image YResolution": "37", "Image ResolutionUnit": "Pixels/Centimeter", "Image Software": "SlidePlayer", "Image YCbCrPositioning": "Centered"}