課程
/后端開發
/Java
/Java入門第二季 升級版
在主方法中導入包,結果顯示the import com.imooc.MyClass is never used,然后運行的時候沒有任何結果
2019-01-05
源自:Java入門第二季 升級版 7-2
正在回答
你的類是MyClass,就改為MyClass test = new MyClass();
警告并不影響你當前運行。你當前沒有任何輸出結果:是因為你只創建了了一個TestMain 的實例test,你想要的應該是在TestMain中創建一個MyTest的實例。你將TestMain test = new Testmain();改為:MyTest test = new MyTest();即可?
首先這類報錯是因為 你導入卻沒有用到,給你的警告 。the import? ?XXXX? ?is never used? (xxx是什么什么包)
?其次 你這個代碼 也并不會有任何輸出結果
舉報
課程升級!以終為始告別枯燥,在開發和重構中體會Java面向對象編程的奧妙
2 回答導入包后提示The import com.mei is never used
6 回答為什么會顯示The value of the local variable phone2 is not used?
3 回答為什么會顯示The value of the local variable phone2 is not used?
2 回答The constructor Student(int, String, int, int, int, String) is undefined
5 回答請問出現The method call() is undefined for the type Azsc 是什么原因?
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2019-01-23
你的類是MyClass,就改為MyClass test = new MyClass();
2019-01-23
警告并不影響你當前運行。你當前沒有任何輸出結果:是因為你只創建了了一個TestMain 的實例test,你想要的應該是在TestMain中創建一個MyTest的實例。你將TestMain test = new Testmain();改為:MyTest test = new MyTest();即可?
2019-01-05
首先這類報錯是因為 你導入卻沒有用到,給你的警告 。the import? ?XXXX? ?is never used? (xxx是什么什么包)
?其次 你這個代碼 也并不會有任何輸出結果