计算机中组成CPU的有,计算机属性 其中组成部分有CPU 硬盘 内存

CUP

package week;

public interface CPU {

public String brand(String brand);

public String frequence(String brand);

}

硬盘

package week;

public interface HardDisk {

public String capacityY(String capacity);

}

内存

package week;

public interface Memory {

public String capacityN(String capacity);

}

计算机性能

package week;

public class Computer implements CPU,HardDisk,Memory{

String brand;

public String brand(String brand) {

this.brand = brand;

return brand;

}

String frequence;

public String frequence(String frequence) {

this.frequence = frequence;

return frequence;

}

String capacity1;

public String capacityY(String capacity) {

this.capacity1 = capacity;

return capacity;

}

String capacity2;

public String capacityN(String capacity) {

this.capacity2 = capacity;

return capacity;

}

public void printer(){

System.out.println("计算机的信息如下:");

System.out.println("CPU的品牌是:"+brand+"主频为:"+frequence);

System.out.println("硬盘容量是:"+capacity1);

System.out.println("内存容量是:"+capacity2);

}

}

测试类

package week;

public class Test {

public static void main(String[] args) {

Computer computer = new Computer();

computer.brand("Inter");

computer.frequence("3.8GHz");

computer.capacityY("3000GB");

computer.capacityN("8GB");

computer.printer();

}

}

测试结果

a54164248d6f0d2cf0b11a56c6cecb48.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值