-1
我正在做一個tic tac腳趾遊戲。這是代碼的一部分,用於檢查哪個按鈕已被按下,並查看該按鈕中是否有圓或十字。如果有一個圓或十字,那麼玩家必須選擇另一個按鈕。錯誤:沒有找到合適的方法toString(字符串)
錯誤消息:
Error:(140, 38) error: no suitable method found for toString(String)
method Arrays.toString(long[]) is not applicable
(argument mismatch; String cannot be converted to long[])
method Arrays.toString(int[]) is not applicable
(argument mismatch; String cannot be converted to int[])
method Arrays.toString(short[]) is not applicable
(argument mismatch; String cannot be converted to short[])
method Arrays.toString(char[]) is not applicable
(argument mismatch; String cannot be converted to char[])
method Arrays.toString(byte[]) is not applicable
(argument mismatch; String cannot be converted to byte[])
method Arrays.toString(boolean[]) is not applicable
(argument mismatch; String cannot be converted to boolean[])
method Arrays.toString(float[]) is not applicable
(argument mismatch; String cannot be converted to float[])
method Arrays.toString(double[]) is not applicable
(argument mismatch; String cannot be converted to double[])
method Arrays.toString(Object[]) is not applicable
(argument mismatch; String cannot be converted to Object[])
我已經得到了這個錯誤,但不知道什麼是錯。
代碼:
@Override
public String toString() {
return Arrays.toString(Circle);
return Arrays.toString(Cross);
}
它看起來像'Circle'和/或'Cross'是一個字符串。你爲什麼要調用'Arrays.toString()'?你的目標是什麼?你能告訴我們更多的代碼嗎? – shmosel