第4章 面向对象(下).ppt

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
1、下列选项中,关于final修饰成员变量的说法正确的是?(?? ? ) A、被final修饰的成员变量可以被多次赋值 B、被final修饰的成员变量为常量 C、final只能在接口中修饰成员变量 D、以上都不对;4、函数重写与函数重载的相同之处是?( ) A、权限修饰符 B、函数名 C、返回值类型 D、形参列表;7、父类中的方法被以下哪个关键字修饰后不能被重写?(? ? ) A、public B、satic C、final D、void;12、下列程序运行结果是(? ) public class Demo { ?? ?public static void main(String[] args) { ?? ??? ?Demo demo = new Demo(); ?? ??? ?demo.show(new Car() { ?? ??? ??? ?public void run() { ?? ??? ??? ??? ?System.out.println(demo run); ?? ??? ??? ?} ?? ??? ?}); ?? ?} ?? ?public void show(Car c) { ?? ??? ?c.run(); ?? ?} } ;abstract class Car { ?? ?public void run() { ?? ??? ?System.out.println(car run...); ?? ?} } A、car run B、demo run C、无结果 D、编译报错;13、下列程序运行结果是( ? ) public class Demo { ?? ?public static void main(String[] args) { ?? ??? ?Object obj=new Father(){ ?? ??? ??? ?public void show(){ ?? ??? ??? ??? ?System.out.println(helloworld); ?? ??? ??? ?} ?? ??? ?}; ?? ??? ?obj.show(); ?? ?} } class Father{ ?? ?public void show(){ ?? ??? ?System.out.println(hello father); ?? ?} } ;14、阅读下列的程序( ) public class Example { ?? ?public static void main(String[] args) { ?? ??? ?new Father () { ?? ??? ??? ?public void show() { ?? ??? ??? ??? ?System.out.println(helloworld); ?? ??? ??? ?} ?? ??? ?}.show(); ?? ?} } class Father { ?? ?public void show() { ?? ??? ?System.out.println(hellofather); ?? ?} };15、分析下面程序,哪一行代码能正确赋值?( ) class Demo { ?? ?public void method() { ?? ??? ?final int num1 = 10;?? ??? ??? ??? ??? ? ?? ??? ?static int num2 = 20;?? ??? ??? ? ?? ???? ?abstract int num3 = 30;?? ??? ? ?? ??? ?private int num4 = 40;?? ? ?? ?} } A、final int num1 = 10; B、static int num2 = 20; C、abstract int num3 = 30; D、private int num4 = 40;;16、已知类的继承关系如下: class Employee; class Manager extends Employeer; class Director extends Employee; 则以下语句能通过编译的有哪些?( ) A、Employee e=new Manager(); B、Director d=new Manager(); C、Director d=new Employee(); D、Manager m=new Director();;18、J

文档评论(0)

清风老月 + 关注
官方认证
内容提供者

该用户很懒,什么也没介绍

认证主体阳春市惠兴图文设计有限公司
IP属地广东
统一社会信用代码/组织机构代码
91441781MA53BEWA2D

1亿VIP精品文档

相关文档