gpt4 book ai didi

java - 从 Jshell 运行 echo 示例

转载 作者:行者123 更新时间:2023-12-04 15:18:54 26 4
gpt4 key购买 nike

<分区>

我读过这样一个命令行参数示例:

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

它从命令行运行正常,我怎么能从 Jshell 运行它呢?

jshell> Echo.main testing
| created variable testing, however, it cannot be referenced until class main is declared

它报告引用失败的错误。

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com