1 public class ThreadJava extends Thread {
2 public static final int N=5;
3 public static final int SLEEP=200;
4 public static final int LEN=20;
8 double d = Math.sqrt(Math.PI);
9 String s = Double.toString(d);
10 double e = Double.parseDouble(s);
11 double f = Math.pow(e, 2);
12 long l1 = Math.round(f);
13 long l2 = Math.round(Math.PI);
15 System.out.println("What is going on???");
19 public static void main(String args[]) {
22 System.out.println("Creating and starting threads ...");
23 for (int i=0; i<N; i++) {
29 System.out.println("Sending Main-Thread to sleep ...");
32 } catch (Exception e) {
33 System.out.println("Exception while sleeping!");
36 System.out.println("Forcing a collection ...");
39 System.out.println("Finished.");