123456789101112131415161718192021222324252627 |
- public class Main {
- public static void main (String argv[]) {
- Thread tA, tB;
- boolean doYield = false;
- if (argv.length == 1) {
- if (argv[0].equals("true"))
- doYield = true;
- }
- else {
- System.err.println("Wrong number of arguments.");
- System.out.println("Usage : java Main true|false");
- return;
- }
- if (doYield)
- System.out.println("Do yield");
- else
- System.out.println("NOT do yield");
- tA = new DispTask(doYield, "tA");
- tB = new DispTask(doYield, "tB");
- tA.start();
- tB.start();
- }
- }
|