4
Parallel execution
- public class TwoThreadsTest {
- public static void main(String[] args) {
- (new SimpleThread("Paris")).start();
- (new SimpleThread("Tokyo")).start();
- }
- }
- public class TwoRunnablesTest {
- public static void main(String[] args) {
- System.out.println(Thread.activeCount());
- (new Thread(new SimpleRunnable("Paris"))).start();
- (new Thread(new SimpleRunnable("Tokyo"))).start();
- System.out.println("DONE! " + "main");
- }
- }
Comments