阿里巴巴(中国)网络技术有限公司 面试 笔试.doc

阿里巴巴(中国)网络技术有限公司 面试 笔试.doc

ID:53252153

大小:258.00 KB

页数:9页

时间:2020-04-02

阿里巴巴(中国)网络技术有限公司 面试 笔试.doc_第1页
阿里巴巴(中国)网络技术有限公司 面试 笔试.doc_第2页
阿里巴巴(中国)网络技术有限公司 面试 笔试.doc_第3页
阿里巴巴(中国)网络技术有限公司 面试 笔试.doc_第4页
阿里巴巴(中国)网络技术有限公司 面试 笔试.doc_第5页
资源描述:

《阿里巴巴(中国)网络技术有限公司 面试 笔试.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、选择题1:1.What will happen when you attempt to compile and run the following code?   2.  3.class Base   4.  5.{  6.  7.int i = 99;   8.  9.public void amethod()  10.  11.{  12.  13.       System.out.println("Base.amethod()");  14.  15.     }  16.  17.     Base()  18.  19.{  20.  21.     ameth

2、od();  22.  23.     }  24.  25.}   26.  27.public class Derived extends Base  28.  29.{  30.  31.int i = -1;  32.  33.         34.  35.public static void main(String argv[])  36.  37.{  38.  39.     Base b = new Derived();  40.  41.       System.out.println(b.i);  1.  2.       b.amethod();

3、  3.  4.     }   5.  6.     public void amethod()  7.  8.{  9.  10.       System.out.println("Derived.amethod()");  11.  12.     }   13.  14.}   15.  16.Choices:  Whatwillhappenwhenyouattempttocompileandrunthefollowingcode?classBase{inti=99;publicvoidamethod(){System.out.println("Base.amet

4、hod()");}Base(){amethod();}}publicclassDerivedextendsBase{inti=-1;publicstaticvoidmain(Stringargv[]){Baseb=newDerived();System.out.println(b.i);b.amethod();}publicvoidamethod(){System.out.println("Derived.amethod()");}}Choices:A.Derived.amethod()-1Derived.amethod()B.Derived.amethod()99C.Co

5、mpiletimeerrorD.Derived.amethod()2:1.Which is the most appropriate code snippet that can be inserted at line 18 in the following code?  2.  3.(Assume that the code is compiled and run with assertions enabled)  4.  5.1.  import java.util.*;  6.  7.2.   8.  9.3.  public class AssertTest  10.

6、  11.4.  {  12.  13.5.      private HashMap cctld;  14.  15.6.       16.  17.7.      public AssertTest()  1.  2.8.      {  3.  4.9.          cctld = new HashMap();  5.  6.10.         cctld.put("in", "India");  7.  8.11.         cctld.put("uk", "United Kingdom");  9.  10.12.         cctld.p

7、ut("au", "Australia");  11.  12.13.         // more code...   13.  14.14.     }  15.  16.15.     // other methods ....    17.  18.16.     public String getCountry(String countryCode)  19.  20.17.     {  21.  22.18.         // What should be inserted here?  23.

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。