亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

老師給我看看!我做完了怎么不顯示結果?。≈x謝!

我做完了怎么不顯示結果啊
package com.imooc;

public class Imooc {
????? //屬性(成員變量)
??????? float screen;
?????????? float cpu;
?????????? float mem;
????? //方法
?????????? void call(){
??????? ??? System.out.println(123456);
?????????? }
?????????? void tcall(){
??????? ??? System.out.println("screen:"+screen+"cpu:"+cpu+"mem"+mem);
?????????? }
??????????
}
package com.imooc;

public class ABC {
????????? public static void mian(String[]args){
??????? ?? Imooc qwe=new Imooc();
??????? ?? qwe.tcall();
????????? }
}

正在回答

3 回答

同一個項目下創建兩個類 放在eclipse里面沒有問題 可以顯示!

0 回復 有任何疑惑可以回復我~

public class Imooc?

{

? ? ? //屬性(成員變量)

? ? ? ? ? ?float screen;

? ? ? ? ? ?float cpu;

? ? ? ? ? ?float mem;

? ? ? //方法 ?第一種:

? ? ? ? ? ?public void call()

? ? ? ? ? ?{

? ? ? ? ? ? System.out.println("123456");

? ? ? ? ? ?}

? ? ? ? ? ?public void tcall(double newScreen,double newCpu,double newMem)

? ? ? ? ? ?{

? ? ? ? ? ? System.out.println("screen:"+newScreen+"cpu:"+newCpu+"mem"+newMem);

? ? ? ? ? ?} ??

??

? ? ? ? ? ?public static void main(String[]args)

? ? ? ? ? ?{

? ? ? ? ? ? ?Imooc qwe=new Imooc();

? ? ? ? ? ? ? qwe.tcall(4.0,5.0,6.0);

? ? ? ? ? ?}

? ? ? ? ? ?/*第二種:使用內部類,將方法定義在類中

? ? ? ? ? ? * public class inter

? ? ? ? ? ?{

? ? ? ? ? public void call()

? ? ? ? ? ? ? ?{

? ? ? ? ? ? ? ? System.out.println("123456");

? ? ? ? ? ? ? ?}

? ? ? ? ? ? ? ?public void tcall(double newScreen,double newCpu,double newMem)

? ? ? ? ? ? ? ?{

? ? ? ? ? ? ? ? System.out.println("screen:"+newScreen+"cpu:"+newCpu+"mem"+newMem);

? ? ? ? ? ? ? ?}

? ?

? ? ? ? ? ?}

? ? ? ? ? ?public static void main(String[]args)

? ? ? ? ? ?{

? ? ? ? ? ? ?Imooc qwe=new Imooc();

? ? ? ? ? ? ?inter inn=qwe.new inter();

? ? ? ? ? ? ?inter.tcall(4.0,5.0,6.0);

? ? ? ? ? ?}

? ? ? ? ? ?*/ ? ? ? ? ?

}



? ??


0 回復 有任何疑惑可以回復我~

public static void mian(String[]args)

?main 寫錯了

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

老師給我看看!我做完了怎么不顯示結果?。≈x謝!

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號