import java.util.Calendar;
public class myApplication
{
public static void main(String args[])
{
int hour,minute,second,i,n;
String param;
param="";
Calendar calendar = Calendar.getInstance();
hour=calendar.get(Calendar.HOUR_OF_DAY) ;
minute=calendar.get(Calendar.MINUTE);
second=calendar.get(Calendar.SECOND);
n=args.length;
if (0==n)
System.out.println("there is no parameter");
else
{ for(i=0;i<n;i++)
param=args[m];
}
System.out.println("the time is" +hour+":" +minute+":"+second);
}
}
请大家帮我看一下这些程序,很简单,却发生了越界的错误,当我要输入参数时,比如说 :java myApplication kkkk; 就会显示错误的信息:Exception in thread "main" java.lang.arrayIndexOutofBoundsException.请大家看一下,究竟是怎么回事,如果不输入参数的话运行是完全正确的。谢谢大家了