package com.Project;
public class Shouji {
float screen;
float cpu;
float cem;
public Shouji(){
System.out.println("无参的构造方法执行啦!");
}
public Shouji(float newScreen,float newCpu,float newCem){
if(screen<3.5f){
System.out.println("你输入的参数有误,制动赋值3.5f");
}else{
screen = newScreen;
}
screen = newScreen;
cpu = newCpu;
cem = newCem;
System.out.println("有参的构造方法执行啦!");
}
public static void main(String[] args) {
Shouji shouji = new Shouji();
Shouji.shouji2 = new Shouji(1.5f,1.4f,2.0f);
}
}
慕工程6256650
啊咿呀
啊咿呀
慕田峪6141110
留得枯荷听雨声lyx
相关分类