September 2005
Beginner
576 pages
13h 6m
English
Because Java applications are run from a command line, you can send information to applications at the same time you run them. The following hypothetical example uses the java interpreter to run an application called TextDisplayer, and it sends two extra items of information to the application, readme.txt and /p:
java TextDisplayer readme.txt /p
Extra information you can send to a program is called an argument. The first argument, if there is one, is provided one space after the name of the application. Each additional argument is also separated by a space.
If you want to include a space inside an argument, you must put quotation marks around the argument, as in the following:
java TextDisplayer readme.txt ...
Read now
Unlock full access