public class Computer { char color; int cpu; public void getDate(){ } public void getDate(char color,int cpu){ this.color = color; this.cpu = cpu; } void a(){ System.out.println("颜色为"+color+",cpu型号为"+cpu); } } public static void main(String[] args) { Rectangle rc = new Rectangle(2,3); a(); }