To make it visible between the instances of T1
and T2
you could make the two classes contain a reference to an object that contains the variable.
If the variable is to be modified when the threads are running, you need to consider synchronization. The best approach depends on your exact requirements, but the main options are as follows:
volatile
;AtomicBoolean
;