public class InitailTelphone {?public static void main(String[] args) {//??Telphone phone = new Telphone();??Telphone.call();??Telphone.cpu = 5.2f;??Telphone.mem = 5.6f;??Telphone.screen = 1.2f;??Telphone.call();}}public class Telphone {?//定義類的屬性?static float screen;?static float cpu;?static float mem;?//定義類的方法?static void call(){??float cpu = 1.22f;??System.out.println("screen:"+screen+"?? cpu:"+cpu+"?? mem:"+mem+"?? Telphone有打電話的功能");?}?void sendMessage(){??System.out.println("Telphone有發短信的功能");?}}
3 回答
添加回答
舉報
0/150
提交
取消