rajani, post your code that tried to use so we can see it. A should be the only correct answer.
sarim, you don't need to post more detail as long as you understand why A is correct and why the rest are not.
Here is my reasoning:
A true - This creates an anonymous class that implements Runnable, creates a thread passing in the implentation of Runnable, then starts the thread.
B false - This creates an anonymous class that extends Thread, but they don't override Thread's run method, so the Thread never starts. Since you are overriding Threads start method, it will run, but it is not creating a Thread and calling Thread's start method which schedules it with the Thread Schedular.
C false - This creates an anonymous class that implements Runnable, but never creates the Thread so you will get a compile error as r has no start() method.
D false - This creates a new Thread where you pass in an object Work, but there is no constructor in the Thread class that supports objects unless the object implements Runnable, which Work never said it did. You can pass in an object that implements Runnable, a
string for the object name, or a ThreadGroup object
E false - The creates an anonymous class that implements Runnable, but it doesn't create a new Thread and call the start method of the new thread. This will compile, but it doesn't create a new thread.
Just my thoughts on the answers. This one I got right the first time through (one of only a few that I got right the first time through
)
Bill
[This message has been edited by bill bozeman (edited December 21, 2000).]