1. Create a program that outputs command-line arguments:
(1) Create a program that outputs every command-line argument, then displays the arguments and their number.
(2) You should use the array variable length to retrieve the length of the array.
(1) Create a program that outputs every command-line argument, then displays the arguments and their number.
(2) You should use the array variable length to retrieve the length of the array.
解决方案 »
- 请问如何吧这个程序的结果输出到一个txt文件中啊?
- java.io.tmpdir输出什么
- java编程结果中文不能正常显示
- java如何实现任意编码文件转UTF8
- 掌握Merlin新的IO类--javaworld部分原文翻译.
- 一个作图程序的问题
- 高分,在线等:为何updatedouble、updatefloat总不成功,而用updateint就可以?
- 告诉我什么地方有Http服务器上的jbuilder7.0下载,我给100分!!
- 有大连理工大学软件学院的吗???
- 蔡学镛老师说的《JAVA SERIES》那里有卖?download?推荐您认为C++程序员的JAVA入门书?
- 初学者的第一个问题
- 用Java实现对Google数据的提取和重新包装?
是不是就是输出aaa bbb 和ccc啊?
{
public static void main(String[] args)
{
if(args.length==0)
{
System.out.println("No Command Line arguments!");
return;
}
for(int i=0; i<args.length; i++)
{
System.out.println(i+","+args[i]);
}
}
}运行:javac test.javajava test aaa bbb ccc ddd输出:
0,aaa
1,bbb
2,ccc
3,ddd