expected在英語中是預料預期的意思,如果在JAVA編程中出現則表示在字符串中輸入了換行符。編譯器就會報錯:Line nn: ';' expected?
處理方法:將字符串拆分為兩個, 確保字符串中都沒有新行, 並將它們與 + 連接起來就可以了。
expected 英[?k?spekt?d] 美[?k?spekt?d]
adj. 預料的; 預期的;
v. 預料; 預期; 預計; 等待; 期待; 盼望; 要求; 指望;
[詞典] expect的過去分詞和過去式;
1、As expected, it rained.?
果不其然下了雨。
2、It may be that you will feel the exact opposite of what you expected.?
可能妳的感覺將和妳的期盼剛好相反。
3、Scientists have collected more data than expected.?
科學家已經收集到了比預期更多的數據。
擴展資料:
expect的用法
1、表示期待,期望,通常為及物動詞,不要受漢語影響在其後誤加介詞for。如:
我們不能期望壹夜之間就取得成功。
如:We should not expect success overnight.
2、後接動詞時要用不定式,不用動名詞。如:
I did not expect to find you here. 我沒料到在這裏碰到妳