Correct main method in Java, and understanding their meanings
<p>I've got a quick question that probably borders on dumb (to you Java experts out there), but I've been having some trouble understanding the basic "main method" syntax and why it seems to vary.</p>

<p>First a little background: I've been taking some basic Java courses, and I've been able to pick it up fairly quickly because I've done some programming in other languages (VBA, Python, etc).</p>

<p>But anyway, for the "main method", this course uses:</p>

<pre><code>public void run() {
    // do whatever we were discussing
}
</code></pre>

<p>However, the compilers I've been using (www.compileonline.com, and now most recently JGrasp) apparently only recognize this:</p>

<pre><code>public static void main(String args[]) {
    // code goes here.
}
</code></pre>

<p>Now I have a basic understanding of this (what "public", "void" and even "static" mean) but I'm not sure I understand why the course lessons use run() and the compilers say otherwise.  I find it interesting that the compilers require the "main" method to be static (like a constant or class variable) and to use a string called args; I've never used this string, but for whatever reason it seems to be needed.</p>

<p>Similarly, the courses I've been learning from use a simple "println" but the compilers need "System.out.println"... just thought I should mention that because I'm thinking it's part of the same situation.</p>

<p>Anyway, does anyone know off-hand what's going on here?  It's no big deal, because it's easy to just copy/paste the compilers' required text into the courses' code to get similar results, but it would be great to actually know why this is the case (as I'm sure this sort of copy/paste strategy will lead to "bugs" in the future).  The only thing that I can come up with off-hand is maybe there was an update to Java that drastically changed certain functions and is not backwards-compatible?  Anyway, thanks in advance for your input. : )</p>
