Parallel Programming WS 2014/2015 - File Counter.java
public class Counter extends Thread { private int c = 1; private String name; Counter(String name) { this.name = name; } public void run() { while (c < 10) { System.out.println(name + " --> " + c); c = c + 1; try {Thread.sleep((int)(Math.random()*100));} catch (InterruptedException e) { } } } }
Generiert mit Camelot | Probleme mit Camelot? | Geändert am: 19.11.2014