Just added a for loop for each thread so that it performs some action for a while.
class B extends Thread {
public void run() {
for(int i = 0; i<100; i++){
System.out.println("Thread...
Type: Posts; User: Miths
Just added a for loop for each thread so that it performs some action for a while.
class B extends Thread {
public void run() {
for(int i = 0; i<100; i++){
System.out.println("Thread...
ThreadC has got maximum priority which is 10, so it has to be processed at first. [ threadC.setPriority(Thread.MAX_PRIORITY); ]
ThreadB has priority which is in between ThreadA and threadC. [...
My Question is, The thread which is been set to MAX_PRIORITY has to be executed first and thread which has LOW_PRIORITY has to be executed last but it's not working so.
Code:
package first;
...
Just now realized the working of join() method. But still setPriority() is a bit confusing me.
INPUT:
threadC.setPriority(Thread.MAX_PRIORITY);
threadB.setPriority(threadA.getPriority() +...
I have a question regarding join(),setPriority() methods. How we can I see the working of these methods?. I could not get the reality in windows OS when i coded in java. Is it due to Windows is...
It's nice to register with Java Programming forums