-3
public String toString() {
return " Recipient:"+ this.toString(this.getRecipient()) +
" CC:"+ this.toString
(
if(this.getCC()==null)
{
getCC() = "";
}
) +
" Subject:"+this.getSubject() +
" Body:"+ this.getBody() +
" files:"+ this.getFiles();
}
我有此錯誤:作業的左側必須是變量是否必要?
getCC()= 「」; < ---------這裏。
您知道爲什麼會發生這種情況? 在此先感謝
您不能將表達式分配給方法調用。 – Eran
嗯,因爲「作業的左側必須是一個變量」 –
你也不能在這樣的另一個表達式中使用'if'語句......也許你正在尋找有條件的'::'操作符? –