如果有人能夠發現此代碼中的錯誤,它將幫助我一噸。 我正在使用Eclipse,並且我正試圖製作一個程序,只需按一下按鈕即可吐出單詞/句子。如果您需要更多信息,請詢問。這段java代碼有什麼問題?
ERROR: 「如果(this.boverall [α]!= 0){」,ERROR消息 「操作員=未定義的參數類型(一個或多個)的布爾,INT!」
public String sentenceOverall()
{
ArrayList<String> toBeUsed = new ArrayList();
for (int a = 0; a < this.soverall.length; a++) {
if (this.boverall[a] != 0) {
toBeUsed.add(this.soverall[a]);
}
}
if (toBeUsed.size() == 2)
{
int sentencePattern = rand.nextInt(10);
if (sentencePattern < 9)
{
String[] OverallOptions = { " The song is overall both ", " Overall, the song is both ", " This song, overall, is both ", " Your song is quite ", " I think that the song is ", " I believe that your song is both ", " Your song is without a doubt ", " In my point of view, this is ", " First of all, thank you for creating this song. This song is very ", " Judging from my position, this song is ", " Personally, I think that the song is ", " All things taken together, I would say that this song is " };
什麼是'boverall'數組? – BitNinja
說實話,我不知道。我發現了一種我想上網的程序,我正在編輯它,因此它吐出了我想要的單詞,但在此之前,我需要修復所有代碼錯誤。 – user3856445
是唯一的一段代碼? –