Discussion :: Threads - Finding the output (Q.No.17)
|Akk said: (Jul 30, 2013)|
|What if the method is synchronized? what will be the output then?
Both threads would be waiting right?
|Priya said: (Aug 11, 2014)|
|The program is not running anyway because of the FOO class. Compile time error.|
|Karan Asthana said: (Aug 30, 2016)|
|Shouldn't we either extend Thread class or implement Runnable interface to make the code errorfree?|
|Tarun said: (Sep 1, 2017)|
|I guess there's an error with thread in "Test" class because if you observer carefully you can find ")" is somewhere at the end for the following line:
Thread t = new Thread(new Runnable()
i.e., at the end of that definition.
Am I correct?
Post your comments here:
Email : (optional)
» Your comments will be displayed only after manual approval.