谁能告诉我如何计算java中的参数个数?
我正在使用log4j,下面是我正在使用的代码,但我仍然看到我的代码在长度=0处卡住了。有什么帮助吗?
public static void main(String args[]) throws RemoteException{
log.info("running Example1");
String sfUrl = "https://ca...ov";
String sfUser ="...";
String sfPass ="...";
log.error(args.length);
if (args.length != 3)
{
log.error("Usage: teamforge-url username password");
}
else
{
sfUrl = args[0];
sfUser = args[1];
sfPass = args[2];发布于 2013-04-09 00:12:41
如果你是从IDE运行的,你必须在你的项目上配置一些运行选项,也许你只是忘记了。只是说说而已,因为args.length是正确的方式。
https://stackoverflow.com/questions/15883013
复制相似问题