(7-7)阅读程序,写出程序运行结果。//写出程序运行结果classEye{//猫的眼睛类privateStringcolor;publicEye(Stringcolor){this.color=color;}publicbooleanequals(Objectobj){Eyee=(Eye)obj;if(this.color.equals(e.color))returntrue;returnfalse;}}classCat{//猫类privateStringname;privateEyeeye;publicCat(Stringname,Eyeeye){this.name=name;this.eye=eye;}publicbooleanequals(Objectobj){Catcat=(Cat)obj;if(this.name.equals(cat.name)&&this.eye.equals(cat.eye))returntrue;returnfalse;}}publicclassCatDemo{publicstaticvoidmain(String[]args){Eyee1=newEye("蓝色");Eyee2=newEye("蓝色");Cattom1=newCat("Tom",e1);Cattom2=newCat("Tom",e1);System.out.println(tom1==tom2);System.out.println(tom1.equals(tom2));}}
查看答案
(7-7)阅读程序,写出程序运行结果。//写出程序运行结果classLeg{//腿privateintlength;publicLeg(intlength){this.length=length;}publicintgetLength(){returnlength;}publicvoidsetLength(intlength){this.length=length;}}classHead{//头privateStringtype;//类型publicHead(Stringtype){this.type=type;}publicStringgetType(){returntype;}publicvoidsetType(Stringtype){this.type=type;}}classPerson{privateStringname;//姓名privatecharsex;//性别privateLegleg;//腿privateHeadhead;//头publicPerson(Stringname){this.name=name;}publicPerson(Stringname,charsex){this(name);this.sex=sex;}publicLeggetLeg(){returnleg;}publicvoidsetLeg(Legleg){this.leg=leg;}publicHeadgetHead(){returnhead;}publicvoidsetHead(Headhead){this.head=head;}publicStringgetPerson(){StringBuffersb=newStringBuffer();sb.append(this.name+leg.getLength()+head.getType());returnsb.toString();}}//测试类publicclassDogDemo{publicstaticvoidmain(String[]args){Legleg=newLeg(30);Headhead=newHead("国字脸");Personzhangfei=newPerson("张飞",'男');zhangfei.setLeg(leg);zhangfei.setHead(head);leg.setLength(80);System.out.println(zhangfei.getPerson());}}
微分因子的极坐标图是()。
A. 正虚轴
B. 负虚轴
C. 正实轴
D. 负实轴
积分因子的极坐标图是()。
A. 正虚轴
B. 负虚轴
C. 正实轴
D. 负实轴
一阶惯性因子:1/(1+jw0.2),w=5时幅值为()。
A. 1.414
B. 0.707
C. 0.5
D. 无正确答案