public class Understand_String_args
{
	public static void main(String[] args)
	{
		System.out.printf("args[0] = %s\n", args[0]);
		System.out.printf("args[1] = %s\n", args[1]);
		System.out.printf("args[2] = %s\n", args[2]);
	}
}

输出结果:

java Understand_String_args Hello world myfriend!
args[0] = Hello
args[1] = world
args[2] = myfriend!