/** * Copyright (c): Uwe Schmidt, FH Wedel * * You may study, modify and distribute this source code * FOR NON-COMMERCIAL PURPOSES ONLY. * This copyright message has to remain unchanged. * * Note that this document is provided 'as is', * WITHOUT WARRANTY of any kind either expressed or implied. */ public class Test { public static void main(String [] args) { System.out.println("main: started"); Thread t = new InterruptedThread(); t.start(); try { Thread.sleep(2000); } catch (InterruptedException e) { } System.out.println("main: thread is interrupted after 2 seconds"); t.interrupt(); System.out.println("main: finished"); } }