TD1: Cleanup the exo1 code.
[TD_SR.git] / TD1 / exo2 / ExThread.java
diff --git a/TD1/exo2/ExThread.java b/TD1/exo2/ExThread.java
deleted file mode 100644 (file)
index 387ea8d..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-import java.util.Random;
-
-public class ExThread implements Runnable {
-    String threadName;
-
-    ExThread(String name) {
-        setName(name);
-    }
-
-    public void setName(String name) {
-        Thread.currentThread().setName(name);
-    }
-
-    public void run() {
-        for (int j = 0; j < 10; j++) {
-            Random rand = new Random();
-            int sleep_time = rand.nextInt(201);
-            try {
-                Thread.sleep(sleep_time);
-            }
-            catch(InterruptedException e) {
-                // this part is executed when an exception (in this example InterruptedException) occurs
-            }
-            String threadName = Thread.currentThread().getName();
-            System.out.println(threadName + " has sleept for " + sleep_time + " ms for the " + (j + 1) + " times");
-        }
-    }
-}