<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">// Answering a question about many $main$ methods:
// + Every class can have one $main$ method
// + Each application (collection of classes in same folder/dir/project) has
//   one $main$ method that starts everything.
// By changing the Main Class name (target name), CodeWarrior will choose the
// $main$ method for the target you chose.

public class Mains {
    public static void main(String[] args) {
        Test1.main(new String[] {"hello 1"});
        Test2.main(new String[] {"hello 2"});
    }
}
/* public */ class Test1 {
    public static void main(String[] args) {
        System.out.println(args[0]);
    }
}
/* public */ class Test2 {
    public static void main(String[] args) {
        System.out.println(args[0]);
    }
}

/* output:
hello 1
hello 2
*/
</pre></body></html>