Skip to content

Instantly share code, notes, and snippets.

View GrantRobertson's full-sized avatar

Grant S. Robertson GrantRobertson

View GitHub Profile
@GrantRobertson
GrantRobertson / ExecutableTest.java
Last active February 6, 2017 03:15
Java example to illustrate the various possible locations for (kinds of) classes that can be within the same .java file... and other stuff
/* ExecutableTest.java
This example program is designed to illustrate:
A) The various possible locations for (kinds of) classes that can be within the same .java file.
B) Which of those classes can contain main methods which adhere to all the rules to be a "true"
main() method.
C) Which of those main() methods can be run from the command line.
D) How to access all of those main methods from within the "main" main() method.
E) It also happens to illustrate some of what can be called from within a static method.
F) And... one of the advantages of using a varargs parameter instead of a String array parameter