理解Java主函数中的"String[] args"

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!
posted @ 2017-06-27 11:29  2021年的顺遂平安君  阅读(307)  评论(0编辑  收藏  举报