It's not a secret anymore!
The moose likes Beginning Java and the fly likes Pls explain the program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Pls explain the program" Watch "Pls explain the program" New topic

Pls explain the program

Niyas Ahmed Sheikh
Ranch Hand

Joined: Jun 15, 2005
Posts: 129

In the above, what will happened when we sending the 'target' object as argument. I can't understand the coding in BOLD. Please explain it, why the object has been send as argument and other related tips in this regd.
Svend Rost
Ranch Hand

Joined: Oct 23, 2002
Posts: 904
You forgot to tell us, what happend when you ran the program.

Disclaimer: I havn't tested the program.

Your three caller objects gets initialized, and as you can see in their

They start themselves as threads, and their run method gets called which
calls the callme object's call method, which prints "[message]" unless
it gets interupted by another thread..

/Svend Rost
I agree. Here's the link:
subject: Pls explain the program
jQuery in Action, 3rd edition