What will be the output of the following program?
public class WorkingWithThread extends Thread {
String str = "";
public WorkingWithThread(String s) { str = s; }
public void run() {
if (str.equals("thread1") | str.equals("thread2")) {
yield();
System.out.println("End of " + str);
}
}
public static void main(String args[]) {
Thread thread1 = new WorkingWithThread("thread1");
Thread thread2 = new WorkingWithThread("thread2");
thread2.setPriority(Thread.MAX_PRIORITY);
thread1.setPriority(Thread.MIN_PRIORITY);
thread1.run();
thread2.run();
}
}