import java.util.Scanner;public class InitailTelphone {public static void main(String[] args) {// TODO Auto-generated method stubScanner input=new Scanner(System.in);System.out.println("請(qǐng)輸入Screen的值");float Screen=input.nextFloat();System.out.println("請(qǐng)輸入Cpu的值");float cpu=input.nextFloat();System.out.println("請(qǐng)輸入Mem的值");float mem=input.nextFloat();Telphone phone2=new Telphone(Screen,cpu,mem);phone2.setScreen(Screen);phone2.setScreen(cpu);phone2.setScreen(mem);System.out.println("screen:"+phone2.getScreen());System.out.println("cpu:"+phone2.getCpu());System.out.println("mem:"+phone2.getMem());}}----------------------------------------------------------------------------------請(qǐng)輸入Screen的值10請(qǐng)輸入Cpu的值20請(qǐng)輸入Mem的值30screen:30.0cpu:20.0mem:30.0
為什么下列代碼輸出后,screen并未正確顯示輸入值,而是顯示mem的輸入值?
UYOU
2022-10-13 15:11:52