Hi Please consider this piece of code class Testthread2 extends Thread { public void run() { System.out.println("starting"); yield(); System.out.println("done"); } } public static void main(String args[]) { Testthread2 tt = new Testthread2; tt.start; } In this example should the yield method not be in a try catch block since the thread gets interrupted by yield?
Bos Indicus
Jim Hall
Ranch Hand
Joined: Nov 29, 2001
Posts: 162
posted
0
The yield() method does not throw an exception, so therefore it needn't be in a try block.