hi Amit Congrus.. please send ur material and sample question to firstname.lastname@example.org.I am trying my 2nd time first time by one question I failed.. Thanks for ur help sundara
posted 16 years ago
Hmm, I found your 2nd Thread example very interesting. Would I be right in assuming that the synchronized method is a bit of a Red Herring. Since the two new Thread Objects have not called start() then they are not currently running Threads. Calling the run() methods of each Thread object is perfectly legal as they are JUST methods of the object, but they won't be running as part of their Threads. Therefore I assume we still have just the user Thread running and hence the two calls to run() will happen one after the other, not concurrecntly, hence the output. If this is correct I can see how the Sun exam is really testing people, as these are not issues dealt with in the books, but something you really need to work out at the time using the knowledge you have. Please reply if this is correct BTW.