rs
String[] list = new String[3];
int index = 0;
while ( (index < args.length) &;&; (index < 3 ) )
{
list[index++] = args[index];
}
// Chexk all the parameters
for (int i = 0; i < list.length; i++)
{
if (list[i].equals"-help")
{
//……
}
//else……
}
}
上面的代码(作为认为的例子),显示了通常的错误。在某些情况下,用户输入了三个或者更多的参数,上述代码将会正常运行。但是如果没