1113中科方德笔试题.doc_第1页
1113中科方德笔试题.doc_第2页
1113中科方德笔试题.doc_第3页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

中科方德笔试题1. Overload和Override的区别,Overloaded的方法是否可以改变返回值的类型。2. 接口是否可以继承接口?抽象类可否实现接口?抽象类可否继承实体?3. HashMap 和 HashTable 区别。4. String 和StringBuffer 区别。5. 排序有那几种方法,请举例。6. 检验登录名,只能输入5-20个以字母开头,可带数字、”_”、”.”的字串,请写出判断登录名是否正确的JavaScript正则表达式。7. 作用域 public private protected 以及不写时的区别。8. 下面程序是否有错,如果有错,错在哪里?public class Somethingpublic static void main(String args)Something s = new Something();System.out.println(s.doSomething() returns+doSomething();public String doSomething()return Do Something;9. 单选题 ()static void test throws RuntimeExceptiontrySystem.out.print(test);throw new RuntimeException();catch(Exception ex)System.out.print(exception);public static void main(String args)trytest();catch(RuntimeException ex)System.out.println(runtime);System.out.print(end);What is the result?A. test endB. Compilation failsC. test runtime endD. test exception endE. A throwable is thrown by main at runtime;10. 选择题 ()A class games.cards.Poker is correctly defined in the jar file Poker.jar . A user wants to execute the main method of Poker on a UNIX system using the command:java games.cards.PokerWhat allows the user to do this?A. put Poker.jar in directory/stuff/java, and set the CLASSPATH to include/stuff/javaB. put Poker.jar in directory/stuff/java, and set the CLASSPATH to include/stuff/java/*.jarC. put Poker.jar in directory/stuff/java, and set the CLASSPATH to include/stuff/java/Poker.jarD. put Poker.jar in directory/stuff/java/games/cards,and set the CLASSPATH to include/stuff/javaE. put Poker.jar in directory/stuff/java/games/cards,and set the CLASSPATH to include/stuff/*.javaF. put Poker.jar in directory/stuff/java/games/cards,and set the CLASSPATH to include/stuff/java/Poker.jar考题一下面代码输出结果是什么,存在什么问题,如何修改?public class MyClassprivate Integer id;private Double value;public MyClass(Integer id)this.id = id;value = Math.random();overridepublic boolean equals(Object obj)if(obj = null | !(obj instanceof MyClass)return false;MyClass myObj = (MyClass)obj;if(id = null | myObj.id = null)return false;return id.equals(myObj.id);public static void main(String args)Map objMap = new HashMap();MyClass objA = new MyClass(1);MyClass objB = new MyClass(2);objMap.put(objA, Im Object A);objMap.put(objB, Im Object B);MyClass objC = new MyClass(1);String result = objMap.get(objC);System.out.pritnln(result);考题二设键盘输入n个英语单词,输入格式为n,w1,w2,.,wn,其中n表示随后输入单词个数,试编一程序,建立一个单向链表,实现: (1)如果单词重复出现,则只在链表上保留一个。 (2)除满足(1)的要求外,链表结点还应有一个计数域,记录该单词重复出现的次数,然后输出出现次数最多的前K(K=n)个单词。考题三编写一个街区字符串的函数,输入为一个字符串和字节数,输入为按字节截取的字符串,但是要保证汉字不被截取半个。如“我ABC”、4,应该截为“我AB”,输入“我AB

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论