This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Threads and Synchronization and the fly likes Is it possible to acceessdifferent parts of class by different threads? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Is it possible to acceessdifferent parts of class by different threads?" Watch "Is it possible to acceessdifferent parts of class by different threads?" New topic
Author

Is it possible to acceessdifferent parts of class by different threads?

shankara me
Greenhorn

Joined: Nov 30, 2012
Posts: 14
Hi !my doubts are based on below programme.
------------------------------------------------------------------


--------------------------------
Here c1 is object of class C.
I have accessed method f1 of object c1 by threads t1 and t2.
My Doubt:
I want to access method f1 by thread t1 and f2 by thread t2.
Is it possible?
If possible please tell me

Jayesh A Lalwani
Bartender

Joined: Jan 17, 2008
Posts: 2277
    
  28

Yes it's possible. 2 threads can call the same class.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Is it possible to acceessdifferent parts of class by different threads?
 
Similar Threads
Thread synchronization
doubt on synchronized block in java
Doubt in Thread
doubt in threads
Basic thread doubt