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();
}
}
田心枫
慕的地6079101
刘小振
轩莫
轩莫
相关分类