Java接口练习(组装电脑)

CPU.java
public interface CPU {

    //获取品牌
    public abstract String getBrand();

    //获取CPU频率
    public abstract String getHZ();
}
EMS.java
public interface EMS {

    //获取内存容量
    public abstract String getEMSCapacity();
}
HardDisk.java
public interface HardDisk {

    //获取硬盘容量
    public abstract String getHardDiskCatacity();
}
AMDCPU.java
public class AMDCPU implements CPU {
    @Override
    public String getBrand() {
        return "AMD";
    }

    @Override
    public String getHZ() {
        return "2000hz";
    }


}
IntelCPU.java
public class IntelCPU implements CPU {
    @Override
    public String getBrand() {
        return "intel";
    }

    @Override

你可能感兴趣的:(练习,笔记,java,开发语言)