gpt4 book ai didi

Java错误: not a statement with charsequence variable

转载 作者:行者123 更新时间:2023-11-30 07:37:53 26 4
gpt4 key购买 nike

我有一个使用 charseqquence 的简单 Java 代码:

static class baloon {
CharSequence Titles[];

public baloon(String lastlevel) {
if(lastlevel.equals("No"))
{
Titles[] = {"What to See", "Gallery", "Getting there", "Need to Know", "Description"};
}
else {
Titles[] = {"Description", "Gallery", "Getting there", "Need to Know"};
}

}

在 Titles[] = {....... 处显示 Java 错误:不是语句

最佳答案

改变

Titles[] = {"What to See", "Gallery", "Getting there", "Need to Know", "Description"};

Titles = new CharSequence[] {"What to See", "Gallery", "Getting there", 
"Need to Know", "Description"};

关于Java错误: not a statement with charsequence variable,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35129394/

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