Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How two different class threads communicate with each
other?. send example code.

Answer Posted / puneet khanna

The threads in java follow Mutual exclusion( synchronized)
and co-operation;

for co-operation they need to talk to each other by messages
saying " i am waiting in the wait q anyone can acquire the
lock of the object" or" i have acquired the lock now by
notify() to the last thread who called wait() or by
notifyall() to all the threads who are in the wait q"

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a condition in programming?

968


What is advantage of java?

962


What is the replace tool?

1087


Why is a constant variable important?

902


Explain the difference between an object-oriented programming language and object-based programming language?

944


How do you use equal in java?

1012


How do you break a loop?

938


When will you define a method as static in Java?

1007


What is the base class for error and exception?

959


What is anagram number?

893


What does sprintf return?

1017


what is a green thread? : Java thread

960


Explain yield() method in thread class ?

1016


What is java thread dump, how can we get java thread dump of a program?

948


What about member inner classes?

1051