Hello, I am working on a program, and I noticed that all my threads are starting and stopping in exactly the same order I put them in, and they are not trading places in the output, or mixing output like concurrent objects should. Here is my code:
public class RaceHorseAppII {
public static void main(String[] args) {
new RaceHorse("Stan").run();
new RaceHorse("Tom").run();
new RaceHorse("Harry").run();
new RaceHorse("Finn").run();
new RaceHorse("Sawyer").run();
}
public static class RaceHorse implements Runnable {
private String name = "";
public RaceHorse(String name){
this.name = name;
}
public void run() {
for(int i = 0 ; i < 50 ; i++){
System.out.println(name);
}
}
}//end inner class
}//end class
Does anyone know why it is doing this?