diff options
Diffstat (limited to 'Master/Reference Architectures and Patterns/hjp5/examples/Listing2202.java')
| -rw-r--r-- | Master/Reference Architectures and Patterns/hjp5/examples/Listing2202.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Master/Reference Architectures and Patterns/hjp5/examples/Listing2202.java b/Master/Reference Architectures and Patterns/hjp5/examples/Listing2202.java new file mode 100644 index 0000000..47ff5d0 --- /dev/null +++ b/Master/Reference Architectures and Patterns/hjp5/examples/Listing2202.java @@ -0,0 +1,28 @@ +/* Listing2202.java */
+
+class MyThread2202
+extends Thread
+{
+ public void run()
+ {
+ int i = 0;
+ while (true) {
+ System.out.println(i++);
+ }
+ }
+}
+
+public class Listing2202
+{
+ public static void main(String[] args)
+ {
+ MyThread2202 t = new MyThread2202();
+ t.start();
+ try {
+ Thread.sleep(2000);
+ } catch (InterruptedException e) {
+ //nichts
+ }
+ t.stop();
+ }
+}
\ No newline at end of file |
