求一份答案,写着卡住了
public class Clothes { private String style; private String color; public Clothes(){ } public Clothes(String style, String color) { this.style = style; this.color = color; } public String getStyle() { return style; } public void setStyle(String style) { this.style = style; } public String getColor() { return color; } public void setColor(String color) { this.color = color; } public String toString(){ return +"爱穿"+color+style; } }
public class Person { private String name; private String clothes; public Person(){ } public Person(String name, String clothes) { this.name = name; this.clothes = clothes; } public Person(String name) { } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getClothes() { return clothes; } public void setClothes(String clothes) { this.clothes = clothes; } public void dress(){ System.out.println(this.getName()+"爱穿"+this.getClothes().getColor+); } }
15
收起
正在回答
1回答
同学你好,很抱歉无法提供代码,程序编写没有统一答案呢,同学可参考问答区同学的代码进行程序编写,编写实现过程中有疑问可随时在问答区发起提出哦。
祝学习愉快~
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星