在线等,JAVA简单例子

来源:百度知道 编辑:UC知道 时间:2024/06/15 20:59:41
class t
{
public static void main(String []args)
{
for(String arg : args)
System.out.println(arg);
}
}
以上代码在dos下为什么出错?截图如下。

你的JDK版本过低,这个语法需要1.5或者以上的JDK

有没有修改环境变量啊 ?

args 为空

在我这里运行蛮好的啊

public class tt
{
public static void main(String []args)
{
for(String arg : args)
System.out.println(arg);
}
}