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

}

}

[2101 byte] By [Cinimooda] at [2007-11-26 17:42:44]
# 1
http://java.sun.com/docs/books/tutorial/essential/concurrency/index.html
DrLaszloJamfa at 2007-7-9 0:10:55 > top of Java-index,Java Essentials,Java Programming...
# 2
> Since> classes A and B are just holding a reference of class> Test, which is not a copy.What does that have to do with anything? Also, A and B are holding a copy of the reference.
CaptainMorgan08a at 2007-7-9 0:10:55 > top of Java-index,Java Essentials,Java Programming...