You can share data between threads by using shared object, or concurrent data-structure like BlockingQueue. See this tutorial to learn inter thread communication in Java. It implements Producer consumer pattern using wait and notify methods, which involves sharing objects between two threads.
-
Previous Java ProgrammingDifference between notify and notifyAll in Java?
-
Next On Java Programming
No Comment to " How do you share data between two thread in Java? "