求一份答案,写着卡住了
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回答
同学你好,很抱歉无法提供代码,程序编写没有统一答案呢,同学可参考问答区同学的代码进行程序编写,编写实现过程中有疑问可随时在问答区发起提出哦。
祝学习愉快~
2023版Java工程师
- 参与学习 人
- 提交作业 8788 份
- 解答问题 9886 个
综合就业常年第一,编程排行常年霸榜,北上广深月薪过万! 不需要基础,无需脱产即可学习,只要你有梦想,想高薪! 全新升级:技术栈升级(包含VUE3.0,ES6,Git)+项目升级(前后端联调与功能升级)
了解课程


恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星