Rectangle myRect;
這里沒初始化,改成
Rectangle myRect = new Rectangle(這里輸入構造方法的參數(shù),如果沒參數(shù)就不用輸);
記住,要用到一個實例,必須先實例化一個實例.what is wrong with the following interffacepublic interface something is wrong{ void aMethod(int aValue){System.out.println("hi mom"):}}接口里面的方法,不能有方法體,改成:public interface somethingiswrong{ void aMethod(int aValue){}}somethingiswrong是我打錯了,沒空格public interface somethingiswrong{ void aMethod(int aValue);}
what is wrong with the following program?
what is wrong with the following program?
ublic class SomethingIsWrong {
public static void main(String[] args){
Rectangle myRect;
myRect.width = 40;
myRect.hight =50;
System.out.println('myRect's area is"+myRect.area());
}
ublic class SomethingIsWrong {
public static void main(String[] args){
Rectangle myRect;
myRect.width = 40;
myRect.hight =50;
System.out.println('myRect's area is"+myRect.area());
}
其他人氣:233 ℃時間:2020-05-30 06:24:18
優(yōu)質解答
我來回答
類似推薦
- what is wrong with the following interfface
- what is wrong with you和what’s up with you有什么區(qū)別?
- 關于what is wrong with
- The following is what seems to be a mathematical proof that two equals one.What's wrong with it?
- what's the matter with和what's wrong with有什么區(qū)別
- 圓形磁體內部磁感線的強弱與圖示方向
- 10.“How long have you been here?” “_______ the end of last month.”
- 一個字的反義詞
- 一籃桃子連籃共重3.8千克,吃掉一半桃后,連籃還重2千克,請問桃子和籃各有多重.
- 8篇暑假英語作文
- 人道主義究竟是指什么
- x-(x-21)=七分之四 解方程
猜你喜歡
- 1動聽的反義詞是什么
- 2hard 比較級到底是harder 還是more hard
- 3一只表的時針長六厘米你,如果走一圈,時針的尖端走過的路程是多少厘米,時針所掃過的面積程是多少厘米?ii
- 4【數(shù)學】高一三角函數(shù)證明題
- 5物理題關于物體運動的快慢
- 6土豆浸沒到底面長8厘米,寬4厘米的長方體玻璃缸中,水面上升了1.5厘米,這個土豆的體積是( )立方厘米
- 7向量 矢量 是幾年級的課程呀?
- 8by/on/take/with表示方式時的區(qū)別
- 9仿照下列詞語的結構規(guī)律,再試著寫幾個
- 10驚嘆不已的已是什么意思
- 11一堆煤12噸,用去了總數(shù)的四分之一,還剩下這堆煤的幾分之幾;如果用去了四分之一噸,還剩下幾噸;如果用去了4噸,用去了這頓煤的幾分之幾?
- 12因參與人體新陳代謝而消耗的氣體是_______(填化學式)謝謝了!