[Java] 纯文本查看 复制代码 public class Disk {
public String disk;
public String CPU;
public double zhupin;
public double rl;
public Disk(String disk,String CPU,double zhupin,double rl)
{
this.disk=disk;
this.CPU=CPU;
this.zhupin=zhupin;
}
public void ShowDisk()
{
System.out.println("硬盘是:"+disk+"容量:"+rl+"CPU是:"+CPU+"主频是:"+zhupin);
}
}
class display
{
public String sanxing;
public double fenbian;
public String luoji;
public display(String sanxing,double fenbian,String luoji)
{
this.sanxing=sanxing;
this.fenbian=fenbian;
this.luoji=luoji;
}
public void showdis()
{
System.out.println("显示器是:"+sanxing+"分辨率是:"+fenbian+"键盘牌子是:"+luoji);
}
}
class Test
{
public static void main(String[] args) {
display d=new display("三星pS202",1024*1024,"罗技ks100");
d.showdis();
Disk a=new Disk("西捷ST3360","AMD",2.4,3);
a.ShowDisk();
}
}
为什么运行不了呢? 哪里错了?
|