concurrent method invocation?
Hi,
this is just a basic question. In the following code the classes A and B - that provide the same functionality - are holding a reference of class Test.
Now imaging, the invoke() method of class A and B would be invoked at exactly the same time. Is the output method of class Test executed one after the other, or at the same time. It should be one after the other, right? Since
classes A and B are just holding a reference of class Test, which is not a copy.
Thanks for explanation in advance!
class A{
Test test;
public A(Test test){
this.test = test;
}
publicvoid invoke(){
test.output();
}
}
class B{
Test test;
public B(Test test){
this.test = test;
}
publicvoid invoke(){
test.output();
}
}
publicclass Test{
A a;
B b;
public Test(){
a =new A(this);
b =new B(this);
}
publicvoid output(){
//output something
}
}

