I am working on a project in which I have several interfaces and two implementation classes that need to implement these two interfaces.
Suppose my first interface is
public Interface interfaceA {
public String abc() throws Exception;
}
And its implementation is
public class TestA implements interfaceA {
}
I call it this:
TestA testA = new TestA();
testA.abc();
Now my second interface is
public Interface interfaceB {
public String xyz() throws Exception;
}
And its implementation is
public class TestB implements interfaceB {
}
I call it this:
TestB testB = new TestB();
testB.xyz();
Problem: -
Now my question is: is there a way I can execute these two implementation classes in parallel? I do not want to run it sequentially.
Meaning, I want to run a parallel implementation TestAand TestB? Can this be done?
source
share