gpt4 book ai didi

JAVA(新手Q)局部变量

转载 作者:行者123 更新时间:2023-12-01 06:54:00 28 4
gpt4 key购买 nike

为什么我不允许启动程序,它说:删除短语 token 。抱歉菜鸟问题(本论坛的第一个问题)

public class Pirma {

public static void main(String[] args) {

String[] wordlistOne = {"ziaurus", "grazus", "baisus", "fainas"};
String[] wordlistTwo = {"afigienas", "negeras", "idomus", "juokingas"};
String[] wordlistThree = {"nekoks", "neidomus", "lameris", "kietas"};

int oneLength = wordlistOne.length;
int twoLength = wordlistTwo.length;
int threeLength = wordlistThree.length;

int rand1 = (int) (Math.random() * oneLength);
int rand2 = (int) (Math.random() * twoLength);
int rand3 = (int) (Math.random() * threeLength);

***String phrase*** = wordlistOne[rand1] + " " + wordlistTwo[rand2] + " " + wordlistThree[rand3];
System.out.println("What we need is" + " " ***phrase***);
}
}

最佳答案

您忘记了 ""短语 之间的 +

关于JAVA(新手Q)局部变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17536662/

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