package com.imooc;public class Telphone { private float screen; private float cpu; private float mem; public Telphone() { System.out.println("construction methordwithout param execute"); } public Telphone(float newscreen,float newcpu,float newmem) { screen=newscreen; cpu=newcpu; mem=newmem; }}package com.imooc;public class initial { /*float screen; float cpu; float mem; public float getscreen() { return screen; }*/ /*public void setscreen(float newscreen) { screen=newscreen; }*/ public static void main(String[] args) { Telphone phone=new Telphone(); Telphone phone2=new Telphone(5.0f,1.4f,2.0f);System.out.println(phone2.screen+phone2.cpu+phone2.mem); }}
4 回答
添加回答
举报
0/150
提交
取消