[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$fPJ3LZsj4PZW9eal-oKMQaJ0BMeAUv_lr3EaBZ_0FY-s":3},{"answer":4,"createTime":5,"id":6,"options":7,"origin":12,"question":19,"related":20,"source":30,"type":31},[],"2024-06-03 16:53:41",148306615,[8,9,10,11],"print( )","super.print( )","super.super.print( )","new C( ).print( )",{"count":13,"courseId":14,"courseImg":15,"courseName":16,"workId":17,"workName":18},10,"99c167c9844ddcc1e04d945d711d2fa3","https:\u002F\u002Ftihai-oss-cloud.itihey.com\u002Fimg\u002F3610f1ffbf10e2079795f5f4e434e846.jpg","Java语言程序设计2024.02.26","71ae1d8e8cb946ab89914e708b850a39","第5章 继承与多态","定义了如下的A、B和C类,则( )语句在划线处能正确调用类C中的print( )方法.class C{ void print() {}}class B extends C{ void print() { }}class A extends B{ void print() { } void show() { ________ }}",[21,32,41,50,59,68,71,81,88,93],{"answer":22,"createTime":5,"id":23,"options":24,"question":29,"source":30,"type":31},[],148306610,[25,26,27,28],"B x = new B( )","B x = new C( )","C x = new C( )","C x = new B( )","已知类B是类C的父类,则不正确的语句是( )","v1",0,{"answer":33,"createTime":5,"id":34,"options":35,"question":40,"source":30,"type":31},[],148306611,[36,37,38,39],"子类不能继承父类的私有成员变量和成员方法","子类能继承父类的非私有成员变量和成员方法","子类只能继承父类public成员变量和成员方法","子类只能继承父类的成员方法,而不继承成员变量","关于继承的说法,正确的是( )",{"answer":42,"createTime":5,"id":43,"options":44,"question":49,"source":30,"type":31},[],148306612,[45,46,47,48],"public float getNum() { return 4.0f; }","public double getNum(float d) { return 3.0f;}","public void getNum(double d) { }","public void getNum() { }","有如下程序,在下划线处添加( )方法,编译时会产生错误. class Good{ public float getNum(){ return 2.0f; }} public class Better extends Good { ________________ }",{"answer":51,"createTime":5,"id":52,"options":53,"question":58,"source":30,"type":31},[],148306613,[54,55,56,57],"equals()","clone()","toString()","hashCode()","覆写Object中的( )方法使对象能够返回有价值的信息",{"answer":60,"createTime":5,"id":61,"options":62,"question":67,"source":30,"type":31},[],148306614,[63,64,65,66],"Base Obj = new Derived( )","Derived Obj = new Base( )","Base Obj = new Base( )","Derived Obj = new Derived( )","Derived类是Base类的子类,下面( )语句是错误的",{"answer":69,"createTime":5,"id":6,"options":70,"question":19,"source":30,"type":31},[],[8,9,10,11],{"answer":72,"createTime":5,"id":73,"options":74,"question":79,"source":30,"type":80},[],148306616,[75,76,77,78],"如果修饰成员变量,则一旦赋了值,就等同一个常量","如果修饰类,则该类只能被一个子类继承","如果修饰成员方法,则该方法不能在子类中被重写","如果修饰成员方法,则该方法所在的类不能被继承","关于final关键字的说法,正确的是( )",1,{"answer":82,"createTime":83,"id":84,"options":85,"question":86,"source":30,"type":87},[],"2026-04-23 06:38:20",148306627,[],"请阅读下面程序,并写出运行结果.class Base{ public int getX() { return 1; } public static int getY() { return 2; }}class Sub extends Base{ public int getX() { return 3; } public static int getY() { return 4; }}public class Demo { public static void main(String[] args) { Sub sub=new Sub(); Base base=(Base) sub; int a=sub.getX()*base.getX(); int b=sub.getY()+base.getY(); System.out.println(a+b); }}",9,{"answer":89,"createTime":83,"id":90,"options":91,"question":92,"source":30,"type":87},[],148306628,[],"请阅读程序,写出程序运行结果.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)); }}",{"answer":94,"createTime":83,"id":95,"options":96,"question":97,"source":30,"type":87},[],148306629,[],"请阅读程序,并写出程序运行结果.class X{ int getX() { return 5; }}class Y extends X{ int getX() { return 6; }}class T extends X{ int getX() { return 7; }}public class Demo10 { public static void main(String[] args) { X x=new X(); Y y=new Y(); X t=new T(); int sum=x.getX()+y.getX()+t.getX(); System.out.println(sum); }}"]