java技术博客

jsp博客
数据加载中……
CommandInput.java
/*
*命令行参数的输入,从命令行输入的任何参数,对于java来讲都是用字符串处理的
*/
public class CommandInput{
public static void main(String[] args){
if(args.length==0){
System.out.println("你没有输出参数,程序退出");

}

else{
System.out.println("你一共输入了"+args.length+"个参数");
if(args[0].equals("h"))
System.out.print("hello");
if(args[0].equals("g"))
System.out.print("Bye-Bye");



for(int i=1;i<args.length;i++)
{
System.out.print("  "+args[i]);

}
}
}
}

posted on 2008-10-22 08:20 郭兴华 阅读(139) 评论(0)  编辑  收藏 所属分类: TESTARRAY


只有注册用户登录后才能发表评论。


网站导航: