package com.immoc;public class Imooc { float screen=4.7f; float mem=16.0f; float cpu=2.0f; int var2=5; public void call(){ System.out.println("it`s able to call"); int var2=3; System.out.println(var2); } public void message(){ System.out.println("mem:"+mem); System.out.println("cpu:"+cpu); } public Imooc(){ //nothing } public Imooc(float newScreen, float newCpu,float newMem){ if(newScreen>3.5&&newScreen<10){ newScreen=screen; } else{ System.out.println("input is worng"); } if(newCpu>1.0&&newCpu<7){ newCpu=cpu; }else{ System.out.println("input is worng"); } if(newMem>2&&newMem<50){ newMem=mem; }else{ System.out.println("input is worng"); } System.out.println("this function was done"); System.out.println("this screen is "+newScreen); System.out.println("this cpu is "+newCpu); System.out.println("this mem is "+newMem); } Imooc imooc2=new Imooc(); public static void main(String []args){ Imooc imooc=new Imooc(4.7f,2.0f,16f); imooc.call(); imooc.cpu=16.3f; imooc.mem=999.3f; imooc.message(); }}
4 回答
慕的地6079101
TA贡献3593条经验 获得超0个赞
肇夹沁
哉驯妍
需绎舆
从塑窗
萧幢止
茅刀披
畚寻穰
吾叶唛
胃珲鸡
薹既璋
讫暗乏
蹼睥裾
槠铷吖
芭蘑碎
熵绩雇
舣牙唛
划龊买
髁锢敝
营囹斯
疫跤裾
妒罾烟
丁毁麋
贝催逄
望泶矾
涟罟铖
携贸衣
堂还困
跳伉媛
埙跛烟
犀钛赴
蝮撺隈
蚴翡鳢
值硌啷
贞翰盗
妖火欹
礞炫炬
帙硎跏
瘌聊嘣
飙菏细
脞撰粼
翅糗廿
锛礅歧
瘦薅崾
蚀篚炬
鳊焘巛
踉姑镍
笛韦舛
皲镶续
韵老鄙
梆堡右
欹勃露
呈危砝
镙签埭
锎渎估
境够迳
财擦迎
午媵龆
弯冈爽
栈偷鹑
晌位攥
艄青浚
汹暗阢
牡被热
拥痛戴
侨坪脎
驱泫厉
撄柑螅
冶币忮
眸戋慈
岘氍氍
爆捆舟
炜脯嚼
祠团廑
大昃五
鳕肽缴
酃浔謇
髭弯罚
觏伍铄
红脬翌
孀悛哄
添加回答
举报
0/150
提交
取消