[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$fbEpBnCYwGbK9qJbUu7DClRIyeqEaproQkFz2nxW-7J8":3},{"answer":4,"createTime":5,"id":6,"options":7,"origin":8,"question":15,"related":16,"source":23,"type":43},[],"2026-05-16 07:48:12",207971056,[],{"count":9,"courseId":10,"courseImg":11,"courseName":12,"workId":13,"workName":14},8,"87c15b01139611bc47ccfa980dc05df0","https:\u002F\u002Ftihai-oss-cloud.itihey.com\u002Fimg\u002F50df1640528a3d76f0004bffacf118c9.png","面向对象程序设计","00307f15468e468a8ff999c38c7959aa","7.7 组合关系小测验","阅读程序,写出程序运行结果.\u002F\u002F写出程序运行结果class Eye {\u002F\u002F 猫的眼睛类 private String color; public Eye(String color) { this.color = color; }}class Cat {\u002F\u002F 猫类 private String name; private Eye eye; public Cat(String name, Eye eye) { this.name = name; this.eye = eye; } public boolean equals(Object obj) { Cat cat = (Cat) obj; if (this.name.equals(cat.name) &amp;&amp; this.eye == cat.eye) return true; return false; }}public class CatDemo { public static void main(String[] args) { Eye e1=new Eye(&quot;蓝色&quot;); Eye e2=new Eye(&quot;蓝色&quot;); Cat tom1=new Cat(&quot;Tom&quot;,e1); Cat tom2=new Cat(&quot;Tom&quot;,e2); System.out.println(tom1==tom2); System.out.println(tom1.equals(tom2)); }}",[17,25,32,38,44,47,52,57],{"answer":18,"createTime":19,"id":20,"options":21,"question":22,"source":23,"type":24},[],"2025-06-25 12:23:50",207971048,[],"下图中,类A与类T是( )关系;类A与接口IX是( )关系;类A与类B、类C和接口IX是( )关系.\u003Cimg src=\"https:\u002F\u002Ftihai-oss-cloud.itihey.com\u002Fimg\u002F59f96e217ca4a82bd6e74e3da067416d.png\">","v1",2,{"answer":26,"createTime":27,"id":28,"options":29,"question":30,"source":23,"type":31},[],"2026-05-31 06:26:41",207971050,[],"请画出组成关系的UML类图,并用Java语言写出组成关系程序结构",4,{"answer":33,"createTime":19,"id":34,"options":35,"question":36,"source":23,"type":37},[],207971052,[],"一台计算机由CPU、硬盘、内存、主板和电源等部件组成.请分析该问题抽象出类,然后用UML类图表示类之间的关系,并用Java语言实现.(建模为组成关系)",7,{"answer":39,"createTime":5,"id":40,"options":41,"question":42,"source":23,"type":43},[],207971054,[],"请阅读程序,写出程序运行结果.\u002F\u002F写出程序运行结果class Eye {\u002F\u002F 猫的眼睛类 private String color; public Eye(String color) { this.color = color; }}class Cat {\u002F\u002F 猫类 private String name; private Eye eye; public Cat(String name, Eye eye) { this.name = name; this.eye = eye; } public boolean equals(Object obj) { Cat cat = (Cat) obj; if (this.name.equals(cat.name) &amp;&amp; this.eye == cat.eye) return true; return false; }} public class CatDemo { public static void main(String[] args) { Eye e1=new Eye(&quot;蓝色&quot;); Eye e2=new Eye(&quot;蓝色&quot;); Cat tom=new Cat(&quot;Tome&quot;,e1); Cat jack=new Cat(&quot;Jack&quot;,e2); System.out.println(tom==jack); System.out.println(tom.equals(jack)); }}",9,{"answer":45,"createTime":5,"id":6,"options":46,"question":15,"source":23,"type":43},[],[],{"answer":48,"createTime":5,"id":49,"options":50,"question":51,"source":23,"type":43},[],207971058,[],"阅读程序,写出程序运行结果.\u002F\u002F写出程序运行结果class Eye {\u002F\u002F 猫的眼睛类 private String color; public Eye(String color) { this.color = color; }} class Cat {\u002F\u002F 猫类 private String name; private Eye eye; public Cat(String name, Eye eye) { this.name = name; this.eye = eye; } public boolean equals(Object obj) { Cat cat = (Cat) obj; if (this.name.equals(cat.name) &amp;&amp; this.eye == cat.eye) return true; return false; }} public class CatDemo { public static void main(String[] args) { Eye e1=new Eye(&quot;蓝色&quot;); Cat tom1=new Cat(&quot;Tom&quot;,e1); Cat tom2=new Cat(&quot;Tom&quot;,e1); System.out.println(tom1==tom2); System.out.println(tom1.equals(tom2)); }}",{"answer":53,"createTime":5,"id":54,"options":55,"question":56,"source":23,"type":43},[],207971060,[],"阅读程序,写出程序运行结果.\u002F\u002F写出程序运行结果class Eye {\u002F\u002F 猫的眼睛类 private String color; public Eye(String color) { this.color = color; } public boolean equals(Object obj) { Eye e=(Eye) obj; if(this.color.equals(e.color)) return true; return false; }} class Cat {\u002F\u002F 猫类 private String name; private Eye eye; public Cat(String name, Eye eye) { this.name = name; this.eye = eye; } public boolean equals(Object obj) { Cat cat = (Cat) obj; if (this.name.equals(cat.name) &amp;&amp; this.eye.equals(cat.eye)) return true; return false; }} public class CatDemo { public static void main(String[] args) { Eye e1=new Eye(&quot;蓝色&quot;); Eye e2=new Eye(&quot;蓝色&quot;); Cat tom1=new Cat(&quot;Tom&quot;,e1); Cat tom2=new Cat(&quot;Tom&quot;,e1); System.out.println(tom1==tom2); System.out.println(tom1.equals(tom2)); }}",{"answer":58,"createTime":5,"id":59,"options":60,"question":61,"source":23,"type":43},[],207971062,[],"阅读程序,写出程序运行结果.\u002F\u002F写出程序运行结果class Leg {\u002F\u002F 腿 private int length; public Leg(int length) { this.length = length; } public int getLength() { return length; } public void setLength(int length) { this.length = length; }}class Head {\u002F\u002F 头 private String type;\u002F\u002F 类型 public Head(String type) { this.type = type; } public String getType() { return type; } public void setType(String type) { this.type = type; }} class Person { private String name;\u002F\u002F 姓名 private char sex;\u002F\u002F 性别 private Leg leg;\u002F\u002F腿 private Head head;\u002F\u002F头 public Person(String name) { this.name = name; } public Person(String name, char sex) { this(name); this.sex=sex; } public Leg getLeg() { return leg; } public void setLeg(Leg leg) { this.leg = leg; } public Head getHead() { return head; } public void setHead(Head head) { this.head = head; } public String getPerson() { StringBuffer sb=new StringBuffer(); sb.append(this.name+leg.getLength()+head.getType()); return sb.toString(); }}\u002F\u002F测试类public class DogDemo { public static void main(String[] args) { Leg leg=new Leg(30); Head head=new Head(&quot;国字脸&quot;); Person zhangfei=new Person(&quot;张飞&quot;,'男'); zhangfei.setLeg(leg); zhangfei.setHead(head); leg.setLength(80); System.out.println(zhangfei.getPerson()); }}"]