Answer the question
In order to leave comments, you need to log in
How do objects behave in multithreaded classes?
If a class A that extends Thread creates an object of a class that is not multi-threaded then the instruction of that class will be executed on the main thread or on the thread created by class A ?
class Main {
public static void main(args)
{
new A.start();
}
}
class A extends Thread {
public void run(){
OtherClass otherClass = new OtherClass()
}
}
class OtherClass {
//code in this thread will be
//executed in the thread created by class A
//or in the main thread ?
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question