电子文档交易市场
安卓APP | ios版本
电子文档交易市场
安卓APP | ios版本

英文北京东方国信java面试

20页
  • 卖家[上传人]:wt****50
  • 文档编号:37629745
  • 上传时间:2018-04-20
  • 文档格式:DOC
  • 文档大小:154KB
  • / 20 举报 版权申诉 马上下载
  • 文本预览
  • 下载提示
  • 常见问题
    • 1、1Part (每题(每题 1 1 分)分)1)Which of the following lines will compile without warning or error? Select all valid answers. a ea) float f=0; b) char c=“0“; c) byte b=157; d) boolean f=null; e) int i=10; 2)What are the valid types for the given variable i ? cpublic class Base private void test() / i = 1; switch (i) static public void main(String a) new Base().test(); Select most appropriate answer. a) char, int b) boolean, byte, char, short, int c) byte, char, short, int d) byte, char, short, int, long

      2、e) Only int3)What is the correct way of declarating main() so that the progarm can be compiled and executed using this entry point. abcfa) static public void main(String args) b) static public void main(String a) c) public static void main(String a) d) static void public main(String a) e) public void main(String a) f) static public void main(char arg)24)What will be output if the program is executed as belowjava -DOne -DTwo -DThree Sample public class Sample public static void main(String argv)

      3、System.out.println(argv2) Select most appropriate answer. b a) One b) Two c) Three d) Exception raised: “java.lang.ArrayIndexOutOfBoundsException: 2“ e) NonePart (每题(每题 1 1 分)分)5)Abstract method cannot be static. True or False ? truea) True b) False6)What will be the output when you compile and execute the following program. d/ class Base void test() System.out.println(“Base.test()“); / public class Child extends Base void test() System.out.println(“Child.test()“); static public void main(String

      4、 a) Child anObj = new Child(); Base baseObj = (Base)anObj;3/Base b=new Child(); /b.test(); baseObj.test(); Select most appropriate answer. a) Child.test() Base.test() b) Base.test() Child.test() c) Base.test() d) Child.test()7)What will be the output when you compile and execute the following program. C / class Base static void test() System.out.println(“Base.test()“); / public class Child extends Base void test() System.out.println(“Child.test()“); Base.test(); /Call the parent method static pu

      5、blic void main(String a) new Child().test(); Select most appropriate answer. a) Child.test() Base.test() b) Child.test() Child.test() c) Compilation error. Cannot override a static method by an instance method d) Runtime error. Cannot override a static method by an instance method48)What will be the output when you compile and execute the following program. Exception is the base class for all the Exception classes. / import java.io.*;class Base void test() throws IOException System.out.println(“

      6、Base.test()“); String a = null;/Complex logic goes here if(a = null) throw new IOException(“); / public class Child extends Base protected void test() throws Exception System.out.println(“Child.test()“); throw new Exception(“); static public void main(String a) try new Child().test(); catch(Exception e) Select most appropriate answer. ba) Child.test() Base.test() b) Compilation Error: The method void test() declared in class Child cannot override the method of the same signature declared in clas

      7、s Base. Their throws clauses are incompatible. c) Compilation Error: The method void test() declared in class Child cannot override the method of the same signature declared in class Base. The access modifier is made more restrictive. d) Runtime error. Cannot make the access modifier more restrictive for test() 5PartPart (每题(每题 1 1 分)分)9)What will be the output when you compile and execute the following program. bpublic class Base private void test() System.out.println(6 + 6 + “(Result)“); stati

      8、c public void main(String a) new Base().test(); Select most appropriate answer. a) 66(Result) b) 12(Result) c) Runtime Error.Incompatible type for +. Cant convert an int to a string. d) Compilation Error.Incompatible type for +. Cant add a string to an int.10) What will be the output when you compile and execute the following program. The symbol means space. e 1:public class Base 2: 3: private void test() 4: 5: String aStr = “One“;6: String bStr = aStr; 7: aStr.toUpperCase(); 8: aStr.trim(); 9: System.out.println(“ + aStr + “,“ + bStr + “); 7: 8: 9: static public void main(String a) 10: new Base().test(); 11: 12: Select most appropriate answer.6a) ONE,One b) One,One c) ONE,One d) ONE,ONE e) One,One 11) What will be the output when you compile and execute the following program. dpublic class Base void test() String aStr = “OneString“; System.out.println(aStr.substring(3,7); static public void main(String a) n

      《英文北京东方国信java面试》由会员wt****50分享,可在线阅读,更多相关《英文北京东方国信java面试》请在金锄头文库上搜索。

      点击阅读更多内容
    最新标签
    信息化课堂中的合作学习结业作业七年级语文 发车时刻表 长途客运 入党志愿书填写模板精品 庆祝建党101周年多体裁诗歌朗诵素材汇编10篇唯一微庆祝 智能家居系统本科论文 心得感悟 雁楠中学 20230513224122 2022 公安主题党日 部编版四年级第三单元综合性学习课件 机关事务中心2022年全面依法治区工作总结及来年工作安排 入党积极分子自我推荐 世界水日ppt 关于构建更高水平的全民健身公共服务体系的意见 空气单元分析 哈里德课件 2022年乡村振兴驻村工作计划 空气教材分析 五年级下册科学教材分析 退役军人事务局季度工作总结 集装箱房合同 2021年财务报表 2022年继续教育公需课 2022年公需课 2022年日历每月一张 名词性从句在写作中的应用 局域网技术与局域网组建 施工网格 薪资体系 运维实施方案 硫酸安全技术 柔韧训练 既有居住建筑节能改造技术规程 建筑工地疫情防控 大型工程技术风险 磷酸二氢钾 2022年小学三年级语文下册教学总结例文 少儿美术-小花 2022年环保倡议书模板六篇 2022年监理辞职报告精选 2022年畅想未来记叙文精品 企业信息化建设与管理课程实验指导书范本 草房子读后感-第1篇 小数乘整数教学PPT课件人教版五年级数学上册 2022年教师个人工作计划范本-工作计划 国学小名士经典诵读电视大赛观后感诵读经典传承美德 医疗质量管理制度 2 2022年小学体育教师学期工作总结
    关于金锄头网 - 版权申诉 - 免责声明 - 诚邀英才 - 联系我们
    手机版 | 川公网安备 51140202000112号 | 经营许可证(蜀ICP备13022795号)
    ©2008-2016 by Sichuan Goldhoe Inc. All Rights Reserved.