Threads - java.lang.IllegalThreadStateException

JavaBeginnerWithNB

Aktives Mitglied
Hallo Programmierer,

ich habe ein kleines Programm geschrieben, dass ein Rennen simuliert. Im Programm sind 2 Gruppen mit je 2 Rennern; Deutschland gegen Japan. Gedacht ist, dass der erste Renner 200 Metern rennen soll und der zweite die übrigen 200 Metern. Folgendes sind die 2 Klassen:

Klasse RaceDemo:
Code:
import java.lang.Thread.State;
import java.util.Map;

public class RaceDemo {
   
    public static RaceRunnable race = new RaceRunnable();
   
    public static ThreadGroup germany = new ThreadGroup("Germany");
    public static Thread gRunner_1 = new Thread(germany, race, "First german runner");
    public static Thread gRunner_2 = new Thread(germany, race, "Seconde german runner");
   
    public static ThreadGroup japan = new ThreadGroup("Japan");
    public static Thread jRunner_1 = new Thread(japan, race, "First japanese runner");
    public static Thread jRunner_2 = new Thread(japan, race, "Seconde japanese runner");                   
   
    public static void main(String[] args)
    {
        State gRunner_1State; State jRunner_1State;
        State gRunner_2State; State jRunner_2State;
       
        long gRaceTime = 0, jRaceTime = 0;
        boolean gAlreadyIn = false, jAlreadyIn = false;
       
        Map<Long, String> map = new HashMap<>();
       
        gRunner_1.start();
        jRunner_1.start();            

        while(true)
        {
            gRunner_1State = gRunner_1.getState();
            gRunner_2State = gRunner_2.getState();
           
            jRunner_1State = jRunner_1.getState();
            jRunner_2State = jRunner_2.getState();                       
                                   
            if (gRunner_2State.equals(State.TERMINATED) && !gAlreadyIn) {
                gRaceTime = System.nanoTime();
                System.out.println(gRaceTime + " mRunner_1-Status: " + gRunner_1State);
                System.out.println(gRaceTime + " mRunner_2-Status: " + gRunner_2State);
                gAlreadyIn = true;
            }
                                   
            if(jRunner_2State.equals(State.TERMINATED) && !jAlreadyIn)
            {
               jRaceTime = System.nanoTime();
               System.out.println(jRaceTime + " jRunner_1-Status: " + jRunner_1State);
                System.out.println(jRaceTime + " jRunner_2-Status: " + jRunner_2State);
               jAlreadyIn = true;
            }                                               
           
            if(gRunner_1State.equals(State.TERMINATED) &&                jRunner_1State.equals(State.TERMINATED))               
            {
                break;
            }
        }       
       
        System.out.println("Endtime of the Group " + germany.getName() + " is: " + gRaceTime);
        System.out.println("Endtime of the Group " + japan.getName() + " is: " + jRaceTime);                                             
    }
}

Zweite Klasse RaceRunnable
Code:
public class RaceRunnable implements Runnable {
   
    public static String winner;     
    public static String firstRunnerReached200M; 
   
    public void race()
    {       
        for (int distance = 1; distance <= 400; distance++) {
            System.out.println("Distance covered by " + Thread.currentThread().getName() + " is: " + distance + " meters");
            boolean isRaceWon = this.isRaceWon(distance);
            if (isRaceWon) {
                break;
            }
            boolean isHalfDistanceReached = this.isHalfDistanceReached(distance);
            if (isHalfDistanceReached) {               
                try {
                    if(firstRunnerReached200M.equals(RaceDemo.gRunner_1.getName()))
                    {
                        RaceDemo.gRunner_2.start();
                        RaceDemo.gRunner_2.join();
                    }
                    else if(firstRunnerReached200M.equals(RaceDemo.jRunner_1.getName()))
                    {
                        RaceDemo.jRunner_2.start();
                        RaceDemo.jRunner_2.join();
                    }                   
                } catch (InterruptedException ex) {
                }
            }
        }     
    }
   
    private boolean isRaceWon(int totalDistanceCovered)
    {
        boolean isRaceWon = false;
        if(RaceRunnable.winner == null && totalDistanceCovered == 400)
        {
            String winnerName = Thread.currentThread().getName();
            RaceRunnable.winner = winnerName;
            System.out.println("Winner is: " + RaceRunnable.winner);
            isRaceWon = true;
        }
        else if(RaceRunnable.winner == null)
        {
            isRaceWon = false;
        }
        else if(RaceRunnable.winner != null)
        {
            isRaceWon = true;
        }
        return isRaceWon;
    }
   
    private boolean isHalfDistanceReached(int halfDistance)
    {
        boolean isHalfDistanceReached = false;
        if(RaceRunnable.firstRunnerReached200M == null && halfDistance == 200)
        {           
            RaceRunnable.firstRunnerReached200M = Thread.currentThread().getName();
            System.out.println("200 Meters reached by: " + RaceRunnable.firstRunnerReached200M);
            isHalfDistanceReached = true;
        }
        else if(RaceRunnable.firstRunnerReached200M == null)
        {
            isHalfDistanceReached = false;
        }
        else if(RaceRunnable.firstRunnerReached200M != null)
        {
            isHalfDistanceReached = true;
        }
        return isHalfDistanceReached;
    }
   
    @Override
    public void run()
    {
        this.race();           
    }
   
}

Irgendwann bekomme ich leider ein Exception

Code:
run:
Distance covered by First german runner is: 1 meters
Distance covered by First german runner is: 2 meters
Distance covered by First german runner is: 3 meters
Distance covered by First german runner is: 4 meters
Distance covered by First german runner is: 5 meters
Distance covered by First japanese runner is: 1 meters
Distance covered by First german runner is: 6 meters
Distance covered by First japanese runner is: 2 meters
Distance covered by First german runner is: 7 meters
Distance covered by First german runner is: 8 meters
Distance covered by First german runner is: 9 meters
Distance covered by First german runner is: 10 meters
Distance covered by First german runner is: 11 meters
Distance covered by First german runner is: 12 meters
Distance covered by First german runner is: 13 meters
Distance covered by First german runner is: 14 meters
Distance covered by First german runner is: 15 meters
Distance covered by First german runner is: 16 meters
Distance covered by First german runner is: 17 meters
Distance covered by First german runner is: 18 meters
Distance covered by First german runner is: 19 meters
Distance covered by First german runner is: 20 meters
Distance covered by First german runner is: 21 meters
Distance covered by First german runner is: 22 meters
Distance covered by First german runner is: 23 meters
Distance covered by First german runner is: 24 meters
Distance covered by First german runner is: 25 meters
Distance covered by First german runner is: 26 meters
Distance covered by First german runner is: 27 meters
Distance covered by First german runner is: 28 meters
Distance covered by First german runner is: 29 meters
Distance covered by First german runner is: 30 meters
Distance covered by First german runner is: 31 meters
Distance covered by First german runner is: 32 meters
Distance covered by First german runner is: 33 meters
Distance covered by First german runner is: 34 meters
Distance covered by First german runner is: 35 meters
Distance covered by First german runner is: 36 meters
Distance covered by First german runner is: 37 meters
Distance covered by First german runner is: 38 meters
Distance covered by First german runner is: 39 meters
Distance covered by First german runner is: 40 meters
Distance covered by First german runner is: 41 meters
Distance covered by First german runner is: 42 meters
Distance covered by First german runner is: 43 meters
Distance covered by First german runner is: 44 meters
Distance covered by First german runner is: 45 meters
Distance covered by First german runner is: 46 meters
Distance covered by First german runner is: 47 meters
Distance covered by First german runner is: 48 meters
Distance covered by First german runner is: 49 meters
Distance covered by First german runner is: 50 meters
Distance covered by First german runner is: 51 meters
Distance covered by First german runner is: 52 meters
Distance covered by First german runner is: 53 meters
Distance covered by First japanese runner is: 3 meters
Distance covered by First japanese runner is: 4 meters
Distance covered by First japanese runner is: 5 meters
Distance covered by First japanese runner is: 6 meters
Distance covered by First japanese runner is: 7 meters
Distance covered by First japanese runner is: 8 meters
Distance covered by First german runner is: 54 meters
Distance covered by First german runner is: 55 meters
Distance covered by First german runner is: 56 meters
Distance covered by First german runner is: 57 meters
Distance covered by First german runner is: 58 meters
Distance covered by First german runner is: 59 meters
Distance covered by First german runner is: 60 meters
Distance covered by First german runner is: 61 meters
Distance covered by First german runner is: 62 meters
Distance covered by First german runner is: 63 meters
Distance covered by First german runner is: 64 meters
Distance covered by First german runner is: 65 meters
Distance covered by First german runner is: 66 meters
Distance covered by First german runner is: 67 meters
Distance covered by First german runner is: 68 meters
Distance covered by First german runner is: 69 meters
Distance covered by First german runner is: 70 meters
Distance covered by First german runner is: 71 meters
Distance covered by First german runner is: 72 meters
Distance covered by First german runner is: 73 meters
Distance covered by First german runner is: 74 meters
Distance covered by First german runner is: 75 meters
Distance covered by First german runner is: 76 meters
Distance covered by First german runner is: 77 meters
Distance covered by First german runner is: 78 meters
Distance covered by First german runner is: 79 meters
Distance covered by First german runner is: 80 meters
Distance covered by First german runner is: 81 meters
Distance covered by First german runner is: 82 meters
Distance covered by First german runner is: 83 meters
Distance covered by First german runner is: 84 meters
Distance covered by First german runner is: 85 meters
Distance covered by First german runner is: 86 meters
Distance covered by First german runner is: 87 meters
Distance covered by First german runner is: 88 meters
Distance covered by First japanese runner is: 9 meters
Distance covered by First german runner is: 89 meters
Distance covered by First japanese runner is: 10 meters
Distance covered by First german runner is: 90 meters
Distance covered by First japanese runner is: 11 meters
Distance covered by First german runner is: 91 meters
Distance covered by First japanese runner is: 12 meters
Distance covered by First german runner is: 92 meters
Distance covered by First japanese runner is: 13 meters
Distance covered by First german runner is: 93 meters
Distance covered by First japanese runner is: 14 meters
Distance covered by First japanese runner is: 15 meters
Distance covered by First german runner is: 94 meters
Distance covered by First japanese runner is: 16 meters
Distance covered by First german runner is: 95 meters
Distance covered by First japanese runner is: 17 meters
Distance covered by First german runner is: 96 meters
Distance covered by First japanese runner is: 18 meters
Distance covered by First japanese runner is: 19 meters
Distance covered by First japanese runner is: 20 meters
Distance covered by First japanese runner is: 21 meters
Distance covered by First japanese runner is: 22 meters
Distance covered by First japanese runner is: 23 meters
Distance covered by First japanese runner is: 24 meters
Distance covered by First japanese runner is: 25 meters
Distance covered by First japanese runner is: 26 meters
Distance covered by First japanese runner is: 27 meters
Distance covered by First japanese runner is: 28 meters
Distance covered by First japanese runner is: 29 meters
Distance covered by First japanese runner is: 30 meters
Distance covered by First japanese runner is: 31 meters
Distance covered by First japanese runner is: 32 meters
Distance covered by First japanese runner is: 33 meters
Distance covered by First japanese runner is: 34 meters
Distance covered by First japanese runner is: 35 meters
Distance covered by First japanese runner is: 36 meters
Distance covered by First japanese runner is: 37 meters
Distance covered by First japanese runner is: 38 meters
Distance covered by First japanese runner is: 39 meters
Distance covered by First japanese runner is: 40 meters
Distance covered by First japanese runner is: 41 meters
Distance covered by First japanese runner is: 42 meters
Distance covered by First japanese runner is: 43 meters
Distance covered by First japanese runner is: 44 meters
Distance covered by First japanese runner is: 45 meters
Distance covered by First japanese runner is: 46 meters
Distance covered by First japanese runner is: 47 meters
Distance covered by First japanese runner is: 48 meters
Distance covered by First japanese runner is: 49 meters
Distance covered by First japanese runner is: 50 meters
Distance covered by First japanese runner is: 51 meters
Distance covered by First japanese runner is: 52 meters
Distance covered by First japanese runner is: 53 meters
Distance covered by First japanese runner is: 54 meters
Distance covered by First japanese runner is: 55 meters
Distance covered by First japanese runner is: 56 meters
Distance covered by First japanese runner is: 57 meters
Distance covered by First japanese runner is: 58 meters
Distance covered by First japanese runner is: 59 meters
Distance covered by First japanese runner is: 60 meters
Distance covered by First japanese runner is: 61 meters
Distance covered by First japanese runner is: 62 meters
Distance covered by First japanese runner is: 63 meters
Distance covered by First japanese runner is: 64 meters
Distance covered by First japanese runner is: 65 meters
Distance covered by First japanese runner is: 66 meters
Distance covered by First japanese runner is: 67 meters
Distance covered by First japanese runner is: 68 meters
Distance covered by First japanese runner is: 69 meters
Distance covered by First japanese runner is: 70 meters
Distance covered by First japanese runner is: 71 meters
Distance covered by First japanese runner is: 72 meters
Distance covered by First japanese runner is: 73 meters
Distance covered by First japanese runner is: 74 meters
Distance covered by First japanese runner is: 75 meters
Distance covered by First japanese runner is: 76 meters
Distance covered by First japanese runner is: 77 meters
Distance covered by First japanese runner is: 78 meters
Distance covered by First japanese runner is: 79 meters
Distance covered by First japanese runner is: 80 meters
Distance covered by First japanese runner is: 81 meters
Distance covered by First japanese runner is: 82 meters
Distance covered by First japanese runner is: 83 meters
Distance covered by First japanese runner is: 84 meters
Distance covered by First japanese runner is: 85 meters
Distance covered by First japanese runner is: 86 meters
Distance covered by First japanese runner is: 87 meters
Distance covered by First japanese runner is: 88 meters
Distance covered by First japanese runner is: 89 meters
Distance covered by First japanese runner is: 90 meters
Distance covered by First japanese runner is: 91 meters
Distance covered by First japanese runner is: 92 meters
Distance covered by First japanese runner is: 93 meters
Distance covered by First japanese runner is: 94 meters
Distance covered by First japanese runner is: 95 meters
Distance covered by First japanese runner is: 96 meters
Distance covered by First japanese runner is: 97 meters
Distance covered by First japanese runner is: 98 meters
Distance covered by First japanese runner is: 99 meters
Distance covered by First japanese runner is: 100 meters
Distance covered by First japanese runner is: 101 meters
Distance covered by First japanese runner is: 102 meters
Distance covered by First japanese runner is: 103 meters
Distance covered by First japanese runner is: 104 meters
Distance covered by First japanese runner is: 105 meters
Distance covered by First japanese runner is: 106 meters
Distance covered by First japanese runner is: 107 meters
Distance covered by First japanese runner is: 108 meters
Distance covered by First japanese runner is: 109 meters
Distance covered by First japanese runner is: 110 meters
Distance covered by First japanese runner is: 111 meters
Distance covered by First japanese runner is: 112 meters
Distance covered by First japanese runner is: 113 meters
Distance covered by First japanese runner is: 114 meters
Distance covered by First japanese runner is: 115 meters
Distance covered by First japanese runner is: 116 meters
Distance covered by First japanese runner is: 117 meters
Distance covered by First japanese runner is: 118 meters
Distance covered by First japanese runner is: 119 meters
Distance covered by First japanese runner is: 120 meters
Distance covered by First japanese runner is: 121 meters
Distance covered by First japanese runner is: 122 meters
Distance covered by First japanese runner is: 123 meters
Distance covered by First japanese runner is: 124 meters
Distance covered by First japanese runner is: 125 meters
Distance covered by First japanese runner is: 126 meters
Distance covered by First japanese runner is: 127 meters
Distance covered by First japanese runner is: 128 meters
Distance covered by First japanese runner is: 129 meters
Distance covered by First japanese runner is: 130 meters
Distance covered by First japanese runner is: 131 meters
Distance covered by First japanese runner is: 132 meters
Distance covered by First japanese runner is: 133 meters
Distance covered by First japanese runner is: 134 meters
Distance covered by First japanese runner is: 135 meters
Distance covered by First japanese runner is: 136 meters
Distance covered by First japanese runner is: 137 meters
Distance covered by First japanese runner is: 138 meters
Distance covered by First japanese runner is: 139 meters
Distance covered by First japanese runner is: 140 meters
Distance covered by First japanese runner is: 141 meters
Distance covered by First japanese runner is: 142 meters
Distance covered by First japanese runner is: 143 meters
Distance covered by First japanese runner is: 144 meters
Exception in thread "Seconde japanese runner" Exception in thread "First german runner" java.lang.IllegalThreadStateException
Distance covered by First japanese runner is: 145 meters
Distance covered by First japanese runner is: 146 meters
Distance covered by First japanese runner is: 147 meters
Distance covered by First japanese runner is: 148 meters
Distance covered by First japanese runner is: 149 meters
Distance covered by First japanese runner is: 150 meters
Distance covered by First japanese runner is: 151 meters
Distance covered by First japanese runner is: 152 meters
Distance covered by First japanese runner is: 153 meters
Distance covered by First japanese runner is: 154 meters
Distance covered by First japanese runner is: 155 meters
Distance covered by First japanese runner is: 156 meters
Distance covered by First japanese runner is: 157 meters
    at java.lang.Thread.start(Thread.java:708Distance covered by First japanese runner is: 158 meters
)
Distance covered by First japanese runner is: 159 meters
    at RaceRunnable.race(Distance covered by First japanese runner is: 160 meters
RaceRunnable.java:44)
Distance covered by First japanese runner is: 161 meters
    at RaceRunnable.run(RaceRunnable.java:97)
Distance covered by First japanese runner is: 162 meters
Distance covered by First japanese runner is: 163 meters
    at java.lang.Thread.run(Thread.java:748)
Distance covered by First japanese runner is: 164 meters
Distance covered by First japanese runner is: 165 meters
Exception in thread "First japanese runner" java.lang.IllegalThreadStateException
Distance covered by First japanese runner is: 166 meters
Distance covered by First japanese runner is: 167 meters
    at java.lang.Thread.start(Thread.java:708)
Distance covered by First japanese runner is: 168 meters
    at RaceRunnable.race(RaceRunnable.java:44Distance covered by First japanese runner is: 169 meters
)
Distance covered by First japanese runner is: 170 meters
    at RaceRunnable.run(RaceRunnable.java:97)
Distance covered by First japanese runner is: 171 meters
Distance covered by First japanese runner is: 172 meters
Distance covered by First japanese runner is: 173 meters
    at java.lang.Thread.run(Thread.java:748)
Distance covered by First japanese runner is: 174 meters
Distance covered by First japanese runner is: 175 meters
java.lang.IllegalThreadStateException
Distance covered by First japanese runner is: 176 meters
Distance covered by First japanese runner is: 177 meters
    at java.lang.Thread.start(Thread.java:708)
Distance covered by First japanese runner is: 178 meters
    at RaceRunnable.race(RaceRunnable.java:44)
Distance covered by First japanese runner is: 179 meters
    at RaceRunnable.run(Distance covered by First japanese runner is: 180 meters
Distance covered by First japanese runner is: 181 meters
RaceRunnable.java:97)
Distance covered by First japanese runner is: 182 meters
Distance covered by First japanese runner is: 183 meters
    at java.lang.Thread.run(Distance covered by First japanese runner is: 184 meters
Distance covered by First japanese runner is: 185 meters
Thread.java:748)
Distance covered by First japanese runner is: 186 meters
Distance covered by First japanese runner is: 187 meters
Distance covered by First japanese runner is: 188 meters
Distance covered by First japanese runner is: 189 meters
Distance covered by First japanese runner is: 190 meters
Distance covered by First japanese runner is: 191 meters
Distance covered by First japanese runner is: 192 meters
Distance covered by First japanese runner is: 193 meters
Distance covered by First japanese runner is: 194 meters
Distance covered by First japanese runner is: 195 meters
Distance covered by First japanese runner is: 196 meters
Distance covered by First japanese runner is: 197 meters
Distance covered by First japanese runner is: 198 meters
Distance covered by First japanese runner is: 199 meters
Distance covered by First japanese runner is: 200 meters
200 Meters reached by: First japanese runner
Distance covered by Seconde japanese runner is: 1 meters
Distance covered by First german runner is: 97 meters
Distance covered by First japanese runner is: 201 meters
832454651016399 jRunner_1-Status: WAITING
832454651016399 jRunner_2-Status: TERMINATED
Endtime of the Group Germany is: 0
Endtime of the Group Japan is: 832454651016399
BUILD SUCCESSFUL (total time: 0 seconds)

Kann mir jemand sagen woran es liegen kann, da ich leider nicht darauf kommen kann.

Danke im voraus
 

mrBrown

Super-Moderator
Mitarbeiter
In RaceRunnable startest du nach der Hälfte den zweiten Thread - allerdings zwei mal den gleichen, da du eine statische Variabel zur Auswahl benutzt, und die eben für alle gleich ist.
 

JavaBeginnerWithNB

Aktives Mitglied
Ich habe den Code etwas modifiziert, sodass ich keine statischen Variablen benutze. Leider kriege ich Stackoverflow Fehlermeldung. Ich glaube, ich muss den ganzen Code ändern :(
Code:
import java.lang.Thread.State;
public class RaceDemo {
       
    //public RaceRunnable race = new RaceRunnable();
   
    public ThreadGroup germany = new ThreadGroup("Germany");
    public Thread gRunner_1 = new Thread(germany, new RaceRunnable(), "First german runner");
    public Thread gRunner_2 = new Thread(germany, new RaceRunnable(), "Seconde german runner");
   
    public ThreadGroup japan = new ThreadGroup("Japan");
    public Thread jRunner_1 = new Thread(japan, new RaceRunnable(), "First japanese runner");
    public Thread jRunner_2 = new Thread(japan, new RaceRunnable(), "Seconde japanese runner");     
   
    public Thread getGRunner_1()
    {
        return gRunner_1;
    }
   
    public Thread getGRunner_2()
    {
        return gRunner_2;
    }
   
    public Thread getJRunner_1()
    {
        return jRunner_1;
    }
   
    public Thread getJRunner_2()
    {
        return jRunner_2;
    }
   
    public void go()
    {
        State gRunner_1State; State jRunner_1State;
        State gRunner_2State; State jRunner_2State;
       
        long gRaceTime = 0, jRaceTime = 0;
        boolean gAlreadyIn = false, jAlreadyIn = false;               
       
        gRunner_1.start();
        jRunner_1.start();             
       
        while(true)
        {
            gRunner_1State = gRunner_1.getState();
            gRunner_2State = gRunner_2.getState();
           
            jRunner_1State = jRunner_1.getState();
            jRunner_2State = jRunner_2.getState();                       
                                   
            if (gRunner_2State.equals(State.TERMINATED) && !gAlreadyIn) {
                gRaceTime = System.nanoTime();
                System.out.println(gRaceTime + " mRunner_1-Status: " + gRunner_1State);
                System.out.println(gRaceTime + " mRunner_2-Status: " + gRunner_2State);
                gAlreadyIn = true;
            }
                                   
            if(jRunner_2State.equals(State.TERMINATED) && !jAlreadyIn)
            {
               jRaceTime = System.nanoTime();
               System.out.println(jRaceTime + " jRunner_1-Status: " + jRunner_1State);
                System.out.println(jRaceTime + " jRunner_2-Status: " + jRunner_2State);
               jAlreadyIn = true;
            }                                               
           
            if(gRunner_1State.equals(State.TERMINATED) && jRunner_1State.equals(State.TERMINATED))               
            {
                break;
            }
        }       
        System.out.println("Endtime of the Group " + germany.getName() + " is: " + gRaceTime);
        System.out.println("Endtime of the Group " + japan.getName() + " is: " + jRaceTime);                                  
    }   
    public static void main(String[] args)
    {
        RaceDemo r = new RaceDemo();
        r.go(); 
    }
}

Code:
public class RaceRunnable implements Runnable {
    public static String winner;     
    public static String firstRunnerReached200M; 
   
    RaceDemo gRunner_1 = new RaceDemo();
    RaceDemo jRunner_1 = new RaceDemo();
    RaceDemo gRunner_2 = new RaceDemo();
    RaceDemo jRunner_2 = new RaceDemo();
   
    public void race()
    {       
        for (int distance = 1; distance <= 400; distance++) {
            System.out.println("Distance covered by " + Thread.currentThread().getName() + " is: " + distance + " meters");
            boolean isRaceWon = this.isRaceWon(distance);
            if (isRaceWon) {
                break;
            }
            boolean isHalfDistanceReached = this.isHalfDistanceReached(distance);
            if (isHalfDistanceReached) {               
                try {
                    if(firstRunnerReached200M.equals(gRunner_1.getGRunner_1().getName()))
                    {
                        gRunner_2.getGRunner_2().start();
                        gRunner_2.getGRunner_2().join();
                    }
                    else if(firstRunnerReached200M.equals(jRunner_1.getJRunner_1().getName()))
                    {
                        jRunner_2.getJRunner_2().start();
                        jRunner_2.getJRunner_2().join();
                    }                   
                } catch (InterruptedException ex) {
                }
            }
        }     
    }
   
    private boolean isRaceWon(int totalDistanceCovered)
    {
        boolean isRaceWon = false;
        if(RaceRunnable.winner == null && totalDistanceCovered == 400)
        {
            String winnerName = Thread.currentThread().getName();
            RaceRunnable.winner = winnerName;
            System.out.println("Winner is: " + RaceRunnable.winner);
            isRaceWon = true;
        }
        else if(RaceRunnable.winner == null)
        {
            isRaceWon = false;
        }
        else if(RaceRunnable.winner != null)
        {
            isRaceWon = true;
        }
        return isRaceWon;
    }
   
    private boolean isHalfDistanceReached(int halfDistance)
    {
        boolean isHalfDistanceReached = false;
        if(RaceRunnable.firstRunnerReached200M == null && halfDistance == 200)
        {           
            RaceRunnable.firstRunnerReached200M = Thread.currentThread().getName();
            System.out.println("200 Meters reached by: " + RaceRunnable.firstRunnerReached200M);
            isHalfDistanceReached = true;
        }
        else if(RaceRunnable.firstRunnerReached200M == null)
        {
            isHalfDistanceReached = false;
        }
        else if(RaceRunnable.firstRunnerReached200M != null)
        {
            isHalfDistanceReached = true;
        }
        return isHalfDistanceReached;
    }
   
    @Override
    public void run()
    {
        this.race();           
    }
   
}
Code:
run:
Exception in thread "main" java.lang.StackOverflowError
    at java.lang.ThreadGroup.<init>(ThreadGroup.java:117)
    at java.lang.ThreadGroup.<init>(ThreadGroup.java:96)
    at RaceDemo.<init>(RaceDemo.java:23)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
    at RaceDemo.<init>(RaceDemo.java:24)
    at RaceRunnable.<init>(RaceRunnable.java:26)
   java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)
 

mrBrown

Super-Moderator
Mitarbeiter
Du solltest dir nochmal Grundlagen angucken, bevor du dich mit Threads beschäftigst ;)
Die kritische statische Variable ist auch immer noch vorhanden...
 

JCODA

Top Contributor
Nur weil du zwei Variablen in unterschiedlichen Klassen gleich benennst, sind die noch lange nicht die Selben.
Hier sollten sich die Runner nicht gegenseitig steuern, sondern die Steuerung sollte von "außen" passieren.
D.h. ein einzelner RaceRunnable kennt nur sich selbst.

Die Grundlagen die oben angesprochen wurden umfassen sowas wie:
Objektweitergabe durch Konstruktor bzw vllt Konstruktor allgemein.
und wo, da bietet sich die Insel an, einfach googeln :)
 
Ähnliche Java Themen
  Titel Forum Antworten Datum
H java.lang.OutOfMemoryError bei der wiederholten Erzeugng von Threads Allgemeine Java-Themen 8
rode45e Java Threads Allgemeine Java-Themen 4
berserkerdq2 Threads, wie genau läuft das in Java ab? (Ich kann Threads erstellen und nutzen, nur das Verständnis) Allgemeine Java-Themen 6
P Threads Java Zugreifen Allgemeine Java-Themen 6
K Problem: Java-Klasse mit mehreren Threads als eigenen Prozess starten Allgemeine Java-Themen 3
M Java Threads - Wait Notify - Verständnisproblem Allgemeine Java-Themen 5
M Java-Threads und Datentypen-Zugriffe Allgemeine Java-Themen 7
6 Java - Threads - parallele Programmierung - Tutorial Allgemeine Java-Themen 6
D Java Daemon Threads Allgemeine Java-Themen 7
A Suche Beratung im Bereich Java Threads. Allgemeine Java-Themen 3
M Threads Allgemeine Java-Themen 1
L Threads Threads in Chatroom Allgemeine Java-Themen 30
berserkerdq2 run-methode eines Threads so programmieren, dass 30x die Sekunde etwas ausgeführt wird. Allgemeine Java-Themen 44
CptK Backpropagation parallelisieren: Kommunikation zwischen den Threads Allgemeine Java-Themen 7
J Eine Frage zu den Threads und Task Allgemeine Java-Themen 1
W Wieviele Threads sind sinnvoll? Allgemeine Java-Themen 8
W Alternative für Threads Allgemeine Java-Themen 6
V Threads Probleme beim Aufrufen von Methoden einer anderen Klasse (Threads) Allgemeine Java-Themen 14
T Multithreading: Wie viele Threads sollte ich erstellen? Allgemeine Java-Themen 12
G Threads vom Mainprogramm steuern Allgemeine Java-Themen 8
S BlockingQueue mit dynamischer Anpassung der Anzahl von Producer und Consumer Threads Allgemeine Java-Themen 1
x46 Threads Threads anhalten Allgemeine Java-Themen 1
J Threads verbessern die Performance NICHT ? Allgemeine Java-Themen 8
W Threads Problem Allgemeine Java-Themen 15
T Threads Tic Tac Toe mit Threads Allgemeine Java-Themen 1
M Threads über Kommandozeile Allgemeine Java-Themen 5
mrbig2017 Threads Chat Programm mit Threads? Allgemeine Java-Themen 2
J Internet Broswer in Threads öffnen Allgemeine Java-Themen 1
B Threads Multithreading Threads sollen warten Allgemeine Java-Themen 12
N 1000 MQTT Messages die Sekunde - 1000 Threads erstellen ? Allgemeine Java-Themen 10
D Threads Parallel laufende Threads Allgemeine Java-Themen 4
J Unvorhersehbares Verhalten - benutze ich die falsche Bedingungsprüfung oder brauche ich Threads? Allgemeine Java-Themen 12
D Eine Forschleife mit Threads abarbeiten um es zu schneller zu machen. Ist das möglich? Allgemeine Java-Themen 20
S Wie kann ich eine kleine Stelle in meinem Code mit multiplen Threads abarbeiten..? Allgemeine Java-Themen 20
P Threads Parallelisierte DB-Abfragen mit variabler Anzahl an Threads Allgemeine Java-Themen 4
J Threads Threads Allgemeine Java-Themen 9
Viktim Threads Liste In unterschiedlichen Threads bearbeiten Allgemeine Java-Themen 23
E Threads Ausführung in Threads ist langsamer als ohne Threads Allgemeine Java-Themen 13
A Anzahl an Threads Systemweit Allgemeine Java-Themen 2
Tausendsassa Input/Output Problem mit der gleichzeitigen Ausgabe zweier Threads Allgemeine Java-Themen 8
S Alle Methodenaufrufe eines Threads notieren..? Allgemeine Java-Themen 7
M Threads JPanel eingeforen mit Threads Allgemeine Java-Themen 2
F Threads Allgemeine Java-Themen 6
F Threads Allgemeine Java-Themen 2
M Sinn von Threads? Allgemeine Java-Themen 1
J Wie erschaffe ich einen sicheren Datenaustausch zwischen Thread und Nicht-Threads Allgemeine Java-Themen 8
L Abfragen ob Threads fertig Allgemeine Java-Themen 3
K KeyEvent in Threads Allgemeine Java-Themen 11
V Threads Weshalb funktionieren meine Threads nicht? Allgemeine Java-Themen 2
Thallius Speicherverhalten von Properties und mehreren Threads Allgemeine Java-Themen 5
L Threads beenden Allgemeine Java-Themen 4
P Threads Threads nicht gleichzeitig starten Allgemeine Java-Themen 3
S Threads Threads werden nicht beendet Allgemeine Java-Themen 2
S Start des zweiten Threads erst nach Beenden des ersten Threads Allgemeine Java-Themen 13
N Threads statische Methoden in Threads Allgemeine Java-Themen 5
P 4 Threads in einer Methode Allgemeine Java-Themen 2
M Eclipse Mehrere Threads, mehrere Konsolen Allgemeine Java-Themen 4
OnDemand Threads und synchronized Allgemeine Java-Themen 9
R LinkedList und Threads: Strukturprobleme bez. löschen von Elementen Allgemeine Java-Themen 3
R LinkedList und Threads - welche Methode ist besser? Allgemeine Java-Themen 2
OnDemand Threads und synvhronized Allgemeine Java-Themen 2
S Problem mit Threads Allgemeine Java-Themen 1
W Threads Threads warten lassen Allgemeine Java-Themen 5
H Optimierung durch Threads Allgemeine Java-Themen 31
B Threads halten sich irgendwie auf... Allgemeine Java-Themen 6
M Threads Allgemeine Java-Themen 8
K JNI: Methoden aus unterschiedlichen Threads aufrufen Allgemeine Java-Themen 3
A Applet Alle Threads beim schließen des Applets beenden Allgemeine Java-Themen 8
A Problem mit der Synchronisierung von Threads Allgemeine Java-Themen 15
R SecurityManager für einzelne Klassen/Threads? Allgemeine Java-Themen 38
O Threads und If Befehle Allgemeine Java-Themen 7
P Threads abwechseln lassen mit wait() und notify() Allgemeine Java-Themen 2
H Sehr viele Threads effizient Verwalten Allgemeine Java-Themen 13
C Threads und Exceptions Allgemeine Java-Themen 7
S Threads Abarbeitungsstatus von Threads in Datei schreiben Allgemeine Java-Themen 2
M Zugriff zweier Threads auf diesselbe Methode Allgemeine Java-Themen 16
E Threads Sudoku Threads Allgemeine Java-Themen 8
Gossi Threads mit unterschiedlichen Aufgaben in einer Klasse? Allgemeine Java-Themen 9
G Threads Ablauf von Threads im Spezialfall Allgemeine Java-Themen 4
V Threads bei quadcore Allgemeine Java-Themen 10
V 1000 Threads oder Iterativ? Allgemeine Java-Themen 11
4 Simple(?) Frage zu Threads Allgemeine Java-Themen 14
B Threads Game of Life - Threads Allgemeine Java-Themen 49
R Threads Exceptions von Threads abfangen im ThreadPool Allgemeine Java-Themen 5
S Threads Ende sämtlicher Threads abwarten Allgemeine Java-Themen 6
S Frage zu Threads (Sichtbarkeit und Verhalten) Allgemeine Java-Themen 11
P Threads- Programming Allgemeine Java-Themen 2
G Threads Klasse Sound und Threads bleiben hängen Allgemeine Java-Themen 4
C Threads Zwei Threads greifen auf LinkedList zu. Allgemeine Java-Themen 12
M OutOfMemoryError in nebenläufigen Threads Allgemeine Java-Themen 6
M Threads dauerhafte bewegung mit threads Allgemeine Java-Themen 11
frankred Threads Auf eine Gruppe von Threads warten Allgemeine Java-Themen 11
J Eure Meinung: Threads verwenden, oder nicht? Allgemeine Java-Themen 6
K Warum wartet diese Funktion auf beenden des Threads? Allgemeine Java-Themen 3
F Mehrere Threads - ein Stack Allgemeine Java-Themen 6
O Wie kann ich das Ende eines Threads melden? Allgemeine Java-Themen 7
J Writer und Threads Allgemeine Java-Themen 2
G mehrere Threads starten/stoppen Allgemeine Java-Themen 4
E Verständnisfrage bezüglich Threads Allgemeine Java-Themen 4
K Zeitkritische Threads Allgemeine Java-Themen 14

Ähnliche Java Themen


Oben