Hi all !!
I have one problem with the following code :
Output : Hi Started
Hello Started
Problem:
How the
Thread objects t1 and t2 are accessing the variable str.I think there should be compile error because of the following justification:
1)Here Thread object t1 is created which is directly accessing run method.
2)In run method str is accessed,which means this.str is accessed which in turn means str variable of t1 is accessed,but t1 object hasn't has str variable its the class exp has str variable.
3)So,how it is accessing variable str.
Please expalin.
[ August 22, 2004: Message edited by: Barry Gaunt ]