上海龙凤1314 shlf

北京神舟航天软件笔试题目摘抄

时间:2018-12-31 12:00:00 资料大全 我要投稿

上海龙凤1314 shlf北京神舟航天软件笔试题目摘抄

上海龙凤1314 shlf   基础篇(100分钟)(满分100分)

北京神舟航天软件笔试题目摘抄

上海龙凤1314 shlf   (一) 不定项选择题(36分,每小题1.5分)

  基本语法测试

上海龙凤1314 shlf   1.给定如下代码

上海龙凤1314 shlf   class Test{

  private int m;

  public static void fun() {

  // some code...

  }

  }

  怎样修改才能使变量m能够在方法fun()中直接使用

上海龙凤1314 shlf   A.改成protected int m

  B. 改成public int m

  C. 改成static int m

上海龙凤1314 shlf   D. 改成int m to int m

上海龙凤1314 shlf   2.下面的方法中那个是public void example(){...}的正确的重载函数(JDK1.4)

  A. public void example( int m){...}

  B. public int example(){...}

上海龙凤1314 shlf   C. public void example2(){...}

  D. public int example ( int m, float f){...}

上海龙凤1314 shlf   3.给出如下定义

上海龙凤1314 shlf   String s = "story";

  下面的表达式中那个是正确的?

  A. s += "books";

  B. char c = s[1];

  C. int len = s.length;//没有()

  D. String t = s.toLowerCase();

  4.给定如下代码段:

  boolean m = false;

上海龙凤1314 shlf   if ( m = false )

  System.out.println("False");

  else

上海龙凤1314 shlf   System.out.println("True");

上海龙凤1314 shlf   其运行结果是什么?

上海龙凤1314 shlf   A. False

  B. True

  C. None

  D. 有错误,无法编译通过.

  5. 所给代码如下:

上海龙凤1314 shlf   1) class Example{

上海龙凤1314 shlf   2) String str;

  3) public Example(){

  4) str= "example";

  5) }

  6) public Example(String s){

  7) str=s;

  8) }

  9) }

上海龙凤1314 shlf   10) class Demo extends Example{

  11) }

  12) public class Test{

上海龙凤1314 shlf   13) public void f () {

  14) Example ex = new Example("Good");

  15) Demo d = new Demo("Good");

  16) }

  17) }

  该代码会在那一行出错?

  A. line 3

  B. line 6

上海龙凤1314 shlf   C. line 10

  D. line 14

  E. line 15

  6. 下面那种描述是正确的?

  A. 在Java中不允许多重继承,这样可以使程序更加可靠

上海龙凤1314 shlf   B. 子类继承父类的所有方法 (包括构造方法)

  C. 一个类可以实现很多接口.

  D. 当一个类实现一个接口,那么他就必须定义该接口中的所有方法,

北京神舟航天软件笔试题目摘抄

上海龙凤1314 shlf   7. 下面关于final、finally、finalize描述正确的是

  A. final可以被用来做常量的.定义关键字

  B. finally可以被用作类限定词

上海龙凤1314 shlf   C. finalize可以被用来进行错误处理

  D. final可以被用来作为垃圾回收的回调函数

  E. final可以被用来作为一个抽象函数的限定词,如: public final abstract fun();

  8. 下面关于String描述正确的是:

上海龙凤1314 shlf   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

上海龙凤1314 shlf   C. String str1 = “aaaa” + “bbbbb” + “aaaa”; 会产生5个对象

  D. String aaa = “aaaaaa\\[dd”.replaceAll(“[“, “c”); aaa的值变为”aaaaaa\\cdd”

上海龙凤1314 shlf   IO方面API测试

  9. 下面哪些Java中的流对象是字节流?

上海龙凤1314 shlf   A. FileInputStream B. BufferedInputStream

  C. PushbackInputStream D. ByteArrayInputStream

  10. 下面的类哪些可以处理Unicode字符?

上海龙凤1314 shlf   A. InputStreamReader

  B. BufferedReader

上海龙凤1314 shlf   C. Writer

上海龙凤1314 shlf   D. PipedInputStream

  Java异常处理

  11. 下面程序的输出结果是什么

  class TestException{

  public static void main( String[] args ){

上海龙凤1314 shlf   int i = 0;

  try {

  if (i == 0) {

上海龙凤1314 shlf   throw new IOException("IO Error");

  }

上海龙凤1314 shlf   } catch (IOException ioex) {

  System.out.print(ioex.getMessage());

  i++;

上海龙凤1314 shlf   } catch (Exception ex) {

上海龙凤1314 shlf   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");

上海龙凤1314 shlf   } else {

上海龙凤1314 shlf   throw new Error( "Unknow Error" ) ;

  }

  } catch( IOException ex ){

上海龙凤1314 shlf   System.out.print(ex.getMessage());

  } catch (Exception ex) {

  System.out.print(ex.getMessage());

  } catch (Throwable tr){

  System.out.print(tr.getMessage());

  }

  }

  }

上海龙凤1314 shlf   A. IO ErrorIO Error

  B. IO ErrorUnknow Error

上海龙凤1314 shlf【北京神舟航天软件笔试题目摘抄】相关文章:

1.北京神舟航天软件笔试题目

2.威盛软件笔试题目

3.北京尼尔森笔试题目

4.德尔福笔试题目(软件类)

5.软件笔试题目测试

6.软件测试常见笔试题目

7.扬智(科技)软件笔试题目

8.上海微创软件笔试题目