最后程序run的时候为什么就输出了3.5,1.4和2.0为什么没出来
我把老师的两个类写在一个类里了:
package fangfa;
public class Goufa {
public static void main(String[] args) {
//Goufa phone = new Goufa();//执行构造方法
Goufa phone2=new Goufa(1.5f,1.4f,2.0f);
}
float screen;//成员变量
float cup;
float mem;
public Goufa(){//构造方法定义,方法名=类名
System.out.println("无参的构造方法执行了!");
}
public Goufa(float newScreen,float newCpu,float newMem){
if(newScreen<3.5f){
screen=3.5f;
System.out.println("输入的屏幕尺寸有问题,自动赋值为:"+screen);
}else{
   screen=newScreen;
   System.out.println("手机的屏幕尺寸为:"+screen);
}
cup=newCpu;
mem=newMem;
System.out.println("手机的cpu为:"+cup);
System.out.println("手机的内存为:"+newMem);
System.out.println("有参的构造方法执行了!");
}
}
运行结果:
输入的屏幕尺寸有问题,自动赋值为:3.5
手机的cpu为:1.4
手机的内存为:2.0
有参的构造方法执行了!
				
		同问,还是没有明白