Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Knute Johnson Newsgroups: comp.lang.java.programmer Subject: How does it know? Date: Fri, 12 Sep 2014 08:11:39 -0700 Organization: A noiseless patient Spider Lines: 37 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 12 Sep 2014 15:11:42 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="9f88abf500e70723148465e543f647d1"; logging-data="19624"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1969D2/i/qRg7DCf5JEQcF7" User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 Cancel-Lock: sha1:UcqlaHpKCnbPWjdIcetThF6eIFc= Xref: csiph.com comp.lang.java.programmer:29950 Give two classes: public class test { public static void main(String... args) { System.out.println("calling test1.main()"); test1.main(); } } public class test1 { public static void main(String... args) { System.out.println("test1"); } } Compiling test.jar and running test produces the following output: C:\Users\Knute Johnson>java test calling test1.main() test1 Adding the .class files to a .jar and running it produces the same: C:\Users\Knute Johnson>java -jar test.jar calling test1.main() test1 I have two questions, the first is how does the test1 class get loaded when test is run from the .jar? When all the .class files are in the working directory they are in the CLASSPATH. Are all of the classes in a .jar in the CLASSPATH too? The second question is, what type is test.main()? I want to be able to put it into a Map. Thanks, knute...