[Java] 纯文本查看 复制代码 public class kun {
public class CPU{
int getSpeed(){
return speed;
}
int speed;
void setSpeed(int m){
speed=m;
}
}
public class HardDisk{
int getAmount(){
return amount;
}
int amount;
void setAmount(int a){
amount=a;
}
}
public class PC{
CPU cpu;
void setCpu(CPU c){
cpu=c;
}
public void show() {
}
}
public static void setHardDisk(HardDisk h){
}
void show(String sudu,String rongliang){
System.out.println(sudu+rongliang);
}
/**
* [url=home.php?mod=space&uid=952169]@Param[/url] args
*/
public static void main(String[] args){
CPU cpu=new CPU();
cpu.setSpeed(2200);
HardDisk disk=new HardDisk();
disk.setAmount(200);
PC pc=new PC();
pc.setCPU(CPU c)=cpu;
pc.setHarDisk(HardDisk h)=disk;
pc.show();
}
}
这个报错不会解决啊,请大佬指点一下 |