gpt4 book ai didi

java - Netbeans Ide 预计为 ')'

转载 作者:行者123 更新时间:2023-12-02 10:57:01 24 4
gpt4 key购买 nike

private void btnUserActionPerformed(java.awt.event.ActionEvent evt) {                                        
String strName,strFood,strAge;
strName=this.txtDogsname.getText();
strFood=this.txtDogsfood.getText();
int age= Integer.parseInt(txtDogsage.getText());
//Changes string to int
this.lbloutput.setText("The Dog's name is "+strName+". "+ strName+"'s favourite food is "+ strFood+". "+strName+"'s Age in human years is"+(age*7);" years old.");
}

似乎无法捕获我错过的地方。感谢您提前提供的帮助。

this.lbloutput.setText("狗的名字是 "+strName+"。"+ strName+"最喜欢的食物是 "+ strFood+"。"+strName+"的人类年龄是"+(age*7 );“岁。”);

^似乎有问题的行

最佳答案

换行

this.lbloutput.setText("The Dog's name is "+strName+". "+ strName+"'s favourite food is "+ strFood+". "+strName+"'s Age in human years is"+(age*7);" years old.");

this.lbloutput.setText("The Dog's name is "+strName+". "+ strName+"'s favourite food is "+ strFood+". "+strName+"'s Age in human years is"+(age*7)+" years old.");

“+(年龄*7);”岁”; 是问题所在。使用 + 连接不正确。

关于java - Netbeans Ide 预计为 ')',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51646480/

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