L
Lars Willich
Assume we have a class and inside a second thread.
How do I access variables und their functions...
a) ...in the inner thread from the enclosing thread (in the sample below: aaa)
b) ...in the outer thread from the inner thread (in the sample below:bbb)
The way I coded them below doesn't work
public class testouter {
static Thread InnerThread;
String bbb = new String(" blahblah ");
...
InnerThread = new Thread(new Runnable() {
String aaa = new String(" hello ");
...
public void run() {
.....
bbb.trim();
while(...) { .....}
System.exit(1); } } );
InnerThread.start();
InnerThread.aaa.trim();
... } }
How do I access variables und their functions...
a) ...in the inner thread from the enclosing thread (in the sample below: aaa)
b) ...in the outer thread from the inner thread (in the sample below:bbb)
The way I coded them below doesn't work
public class testouter {
static Thread InnerThread;
String bbb = new String(" blahblah ");
...
InnerThread = new Thread(new Runnable() {
String aaa = new String(" hello ");
...
public void run() {
.....
bbb.trim();
while(...) { .....}
System.exit(1); } } );
InnerThread.start();
InnerThread.aaa.trim();
... } }