I have a Player.java
class and a Driver.java
class. I need to set up communication between threads. I have them set up in an array and I am able to access the attributes from each in my main(). However, I need to use synchronization with my program and am not sure how to access my threads (created in Driver
) in my Player
class.
How can I access these threads outside of the main()
method in order to manipulate them in my run()
method?