Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Jason Kim Newsgroups: comp.lang.java.programmer Subject: How are multiple Java files compiled together? Date: Sun, 27 May 2012 15:48:01 -0700 (PDT) Organization: http://groups.google.com Lines: 49 Message-ID: <90a3f6ec-dfd4-472b-866d-98eaa92364d5@googlegroups.com> NNTP-Posting-Host: 99.225.172.85 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1338158965 29112 127.0.0.1 (27 May 2012 22:49:25 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 27 May 2012 22:49:25 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=99.225.172.85; posting-account=4LCOEAoAAACHihYYC_-TOqhexKccnWug User-Agent: G2/1.0 X-Received-Bytes: 2066 Xref: csiph.com comp.lang.java.programmer:14843 I am new to Java. Here are two files. VolcanoApplication.java class VolcanoApplication { public static void main(String[] arguments) { VolcanoRobot dante = new VolcanoRobot(); dante.status = "exploring"; dante.speed = 2; dante.temperature = 510; dante.showAttributes(); System.out.println("Increasing speed to 3."); dante.speed = 3; dante.showAttributes(); System.out.println("Changing temperature to 670"); dante.temperature = 670; dante.showAttributes(); System.out.println("Checking the temperature."); dante.checkTemperatur(); dante.showAttributes(); } } VolcanoRobot.java class VolcanoRobot { String status; int speed; float temperature; void checkTemperatur() { if (temperature > 50) { status = "returning home"; speed = 5; } } void showAttributes() { System.out.println("Status: " + status); System.out.println("Speed: " + speed); System.out.println("Temperature: " + temperature); } } I compiled the program by doing $ javac VolcanoApplication.java But how does Java know that VolcanoRobot.java should also be in the compilation?