JAVA: just a bug?
Hello world! I hope you will be able to get me out from this, I am lost! Did I miss something regarding the setPriority() method? The code here below works very well on my computer. Threads Pro Challenge: public class Main { public static void main(String[ ] args) { Name name = new Name(); //set priority name.setPriority(2); Welcome welcome = new Welcome(); //set priority welcome.setPriority(1); name.start(); welcome.start(); } } //extend the Thread class class Welcome extends Thread{ public void run() { System.out.println("Welcome!"); } } //extend the Thread class class Name extends Thread{ public void run() { System.out.println("Please enter your name"); } } After trying to understand why, finally, I could solve the challenge by changing the code line order of the method start(). I mean: name.start(); welcome.start(); by this: welcome.start(); name.start(); I was really happy to solve the challenge but at the end it seems me that something is wrong on this exercise that I don't understand yet. Please world, enlighten me!