第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

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

為什么我的會報錯

package com.test;


public class iphone {

public static void main(String[]args){

iphone hello=new iphone();

hello.screen=5.0f;

hello.cpu=5.5f;

hello.price=5200;

hello.yy();

hello.call();

}


}

package com.test;


public class miphone {

float screen;

float cpu;

int price;


void yy() {

System.out.println("發(fā)信息!");

}


void call() {

System.out.println("screen:" + screen + "cpu:" + cpu + "price:" + price);

}

}


正在回答

2 回答

	public?void?yy()?{
		System.out.println("發(fā)信息!");
	}

	public?void?call()?{
		System.out.println("screen:"?+?screen?+?"cpu:"?+?cpu?+?"price:"?+?price);
	}

我建議你把構(gòu)造方法放在main前面

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

干嘛好呢 提問者

非常感謝!
2016-02-13 回復(fù) 有任何疑惑可以回復(fù)我~

public void yy() {

}

public void call() {

}

這么寫 試試

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消
Java入門第二季 升級版
  • 參與學(xué)習(xí)       531140    人
  • 解答問題       6326    個

課程升級!以終為始告別枯燥,在開發(fā)和重構(gòu)中體會Java面向?qū)ο缶幊痰膴W妙

進入課程

為什么我的會報錯

我要回答 關(guān)注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號