Can you explain what is missing?
The order of the output shows the order the statements were executed in. Which thread gets execution will depend on which one is ready to execute and also on...
Type: Posts; User: Norm
Can you explain what is missing?
The order of the output shows the order the statements were executed in. Which thread gets execution will depend on which one is ready to execute and also on...
The println does not say what object it is in (each has a unique num value)
and does not print when the method begins - add another println at the beginning of the method so you see when the method...
When the class extends Thread, setPriority() is in the Thread class and the code should now compile.
Try doing some debugging by adding some println methods to show when the methods are executed...
That may be the right method to use. You need to get a reference to the thread that is executing so you can change its priority.
Using Threads this way is tricky. I'm not sure you will get the...
How does creating a thread and setting its priority change the priority of the thread that is executing the method? If you want to change the priority of the thread for the executing method, you...
An interface does not define methods. When a class implements an interface, the class is required to define(provide code for) all the methods defined in the interface....
Where is the setPriority() method defined? It looks like the compiler can not find its definition in the class where it is used.