神舟软件 2013 软件
技术研发
本套题共33题,暂无参考答案
题目详情
第1题

Java笔试试题
  基础篇(100分钟)(满分100分)
  (一) 不定项选择题(36分,每小题1.5分)
  基本语法测试
  1.给定如下代码
  class Test{
  private int m;
  public static void fun() {
  // some code...
  }
  }
  怎样修改才能使变量m能够在方法fun()中直接使用
  A.改成protected int m
  B. 改成public int m
  C. 改成static int m
  D. 改成int m to int m


第2题

 2.下面的方法中那个是public void example(){...}的正确的重载函数(JDK1.4)
  A. public void example( int m){...}
  B. public int example(){...}
  C. public void example2(){...}
  D. public int example ( int m, float f){...}


第3题

3.给出如下定义
  String s = "story";
  下面的表达式中那个是正确的?
  A. s += "books";
  B. char c = s[1];
  C. int len = s.length;//没有()
  D. String t = s.toLowerCase();


第4题

 4.给定如下代码段:
  boolean m = false;
  if ( m = false )
  System.out.println("False");
  else
  System.out.println("True");
  其运行结果是什么?
  A. False
  B. True
  C. None
  D. 有错误,无法编译通过.


第5题

5. 所给代码如下:
  1) class Example{
  2) String str;
  3) public Example(){
  4) str= "example";
  5) }
  6) public Example(String s){
  7) str=s;
  8) }
  9) }
  10) class Demo extends Example{
  11) }
  12) public class Test{
  13) public void f () {
  14) Example ex = new Example("Good");
  15) Demo d = new Demo("Good");
  16) }
  17) }
  该代码会在那一行出错?
  A. line 3
  B. line 6
  C. line 10
  D. line 14
  E. line 15


第6题

6. 下面那种描述是正确的?
  A. 在Java中不允许多重继承,这样可以使程序更加可靠
  B. 子类继承父类的所有方法 (包括构造方法)
  C. 一个类可以实现很多接口.
  D. 当一个类实现一个接口,那么他就必须定义该接口中的所有方法。


第7题

7. 下面关于final、finally、finalize描述正确的是
  A. final可以被用来做常量的定义关键字
  B. finally可以被用作类限定词
  C. finalize可以被用来进行错误处理
  D. final可以被用来作为垃圾回收的回调函数
  E. final可以被用来作为一个抽象函数的限定词,如: public final abstract fun();


第8题

8. 下面关于String描述正确的是:
  A. String str1=”aa”; String str2=”aa”; System.out.println((str1==str2)); 输出为true
  B. String str1=”aa”; String str2=”aa”; System.out.println(str1.equals(str2)); 输出为true
  C. String str1 = “aaaa” + “bbbbb” + “aaaa”; 会产生5个对象
  D. String aaa = “aaaaaa\\[dd”.replaceAll(“[“, “c”); aaa的值变为”aaaaaa\\cdd”
  IO方面API测试


第9题

9. 下面哪些Java中的流对象是字节流?
  A. FileInputStream B. BufferedInputStream
  C. PushbackInputStream D. ByteArrayInputStream


第10题

10. 下面的类哪些可以处理Unicode字符?
  A. InputStreamReader
  B. BufferedReader
  C. Writer
  D. PipedInputStream
  Java异常处理


第11题

11. 下面程序的输出结果是什么
  class TestException{
  public static void main( String[] args ){
  int i = 0;
  try {
  if (i == 0) {
  throw new IOException("IO Error");
  }
  } catch (IOException ioex) {
  System.out.print(ioex.getMessage());
  i++;
  } catch (Exception ex) {
  System.out.print("Exception Find") ;
  i += 2;
  } finally {
  i++;
  }
  try {
  if (i == 1) {
  throw new IOException("IO Error");
  }
  if (i == 2) {
  throw new Exception("Exception Find");
  } else {
  throw new Error( "Unknow Error" ) ;
  }
  } catch( IOException ex ){
  System.out.print(ex.getMessage());
  } catch (Exception ex) {
  System.out.print(ex.getMessage());
  } catch (Throwable tr){
  System.out.print(tr.getMessage());
  }
  }
  }
  A. IO ErrorIO Error
  B. IO ErrorUnknow Error
  C. IO ErrorException Find
  D. Exception FindIO Error
  E. Exception FindException Find
  Java多线程测试


第12题

12. 如果一个线程调用了wait(), 那个方法可以让他继续运行?
  A. join()
  B. resume()
  C. notify()
  D. notifyAll()
  E. high priority thread is ready


第13题

13. 下面那个方法被用来定义线程的执行体?
  A. start()
  B. init()
  C. run()
  D. main()
  E. synchronized()


第14题

14. 下面那个关键字用于对线程进行互斥访问控制?
  A. native
  B. static
  C. synchronized
  D. abstract
  数据结构API


第15题

15. 下面那个Java中的类可以用来保存数据时随机访问效率较高
  A. ArrayList B. Vector C.LinkList D.Stack


第16题

16. 下面那个Java类中可以用来用来保存键值对
  A. HashSet B. HashMap C.LinkList D.Stack
  Swing开发测试


第17题

17. 下面那个容器对象必须要添加到其他的容器对象中才能使用?
  A. Window
  B. Frame
  C. Dialog
  D. Panel


第18题

18. 下面哪些类是Java中的布局管理器?
  A. CardLayout
  B. BorderLayout
  C. PanelLayout
  D. GridLayout
  E. BagLayout


第19题

19. 将一个Button放置到一个Frame中,使这个Button的高随着Frame的改变而改变,但是宽度不随之改变,应该采用哪种布局方式?
  A. FlowLayout
  B. CardLayout
  C. North and South of BorderLayout
  D. East and West of BorderLayout
  E. GridLayout


第20题

 20. 下面哪些方法能够在类EventObject中得到事件源?
  A. getFrame() B. getID()
  C. getSource() D. getWindow()


共有 33 道题目