【发布时间】:2021-03-02 22:24:07
【问题描述】:
如果我使用java example hello 3 运行我的代码,输出将是hello 3
但是,如果我想运行 java example hello world 3,输出将是 hello world 而不是 hello world 3
我该如何解决这个问题?
public static void main(String[] args){
String t = args[1];
int s = Integer.parseInt(args[0]);
System.out.println(t)
System.out.println(s)
【问题讨论】:
-
你真的在那些输入上运行你的程序并得到这些结果吗?您发布的代码无法编译。