南京财经大学
  1. 根据语句Record[] data = new Record[10];可以断定Record一定是具体类。( )

  2. A:对 B:错
    答案:错
  3. 已知a、b均为Point类型的变量并且a.equals(b)的值为true,那么我们可以判断Point类一定覆盖了equals方法。( )

  4. A:错 B:对
    答案:错
  5. 一个Java类可以申明一个父类同时实现多个接口。( )

  6. A:错 B:对
    答案:对
  7. 表达式new Person()==new Person()的值一定为false。( )

  8. A:错 B:对
    答案:对
  9. Java程序只有8种简单数据类型,java.lang包内为每种简单数据类型申明了一个对应的引用数据类型,我们把这些引用数据类型称为封装类。( )

  10. A:错 B:对
    答案:对
  11. 语句int a = new Integer(10);在语法上是错误的。( )

  12. A:对 B:错
    答案:错
  13. 语句Person[] friends = new Person[10];执行后内存中将增加11个新对象。( )

  14. A:对 B:错
    答案:错
  15. 根据申明public class Circle extends Shape{}可知Shape类一定是具体类。( )

  16. A:对 B:错
    答案:错
  17. 语句System.out.println(new Person());等价于语句System.out.println(new Person().toStrng());。( )

  18. A:对 B:错
    答案:A:对
  19. InputStreamReader类的作用是用来将字节流转换成字符流。( )

  20. A:对 B:错
  21. 在集成开发环境中运行一个Java程序时,不需要对源程序进行编译就可以直接运行。( )

  22. A:错 B:对
  23. 在一个Java类中可以申明很多方法,但是运行时不一定都会被执行。( )

  24. A:错 B:对
  25. 即使一个抽象类中没有申明任何抽象方法,我们也不可以使用new调用其构造方法来创建对象。( )

  26. A:错 B:对
  27. 语句System.out.println(10 + 10 +“hello”+ 10 + 10);运行后将输出1010hello1010。( )

  28. A:错 B:对
  29. 语法上正确的程序一定能够正确运行结束。( )

  30. A:错 B:对
  31. 根据如下给定的部分部分片段可以得出结论( )。public class Test{public static void main(String[] args){Point p = new Point(10, 20);Circle c = new Circle(p, 12.8);System.out.println(p.getInfo());System.out.println(c.getInfo());}}

  32. A:Circle类一定有toString方法
    B:Circle类一定显式申明了形如Circle(Point p, double d)的构造方法
    C:Circle类覆盖了父类中的getInfo方法
    D:Circle类是Point类的子类
  33. 根据如下程序选择正确的说法( )。public class Point{int x, y;public String getInfo(){return “(” + this.x + “,” + this.y + “)”;}public static void main(String[] args){         Point p1 = new Point();Point p2 = p1;p2.x = 12;         System.out.println(“p1: ” + p1.getInfo());         System.out.println(“p2: ” + p2.getInfo());}}

  34. A:p2.getInfo()得到的结果是(12, 0)
    B:p1.getInfo()得到的结果是(0, 0)
    C:程序总共创建了1个Point对象
    D:p2.getInfo()得到的结果是(0, 0)
  35. 运行下面程序将输出结果( )。public class Point{         int x=10;         int y = 10;         public Point(){                   this.x = 30;                   this.y = 30;}public String getInfo(){         return “(”+ x + “,” + y +“)”;}public static void main(String[] args){         System.out.println(“Point:” + new Point().getInfo());}}

  36. A:Point:(10,10)
    B:Point:(30,30)
    C:Point:
    D:Point:null
  37. 用于从文件中读取字符内容的类是( )。

  38. A:InputStream
    B:FileReader
    C:Reader
    D:FileInputStream
  39. 根据语句String info=getInfo();选择正确的getInfo方法( )。

  40. A:public void getInfo(){return “Hello World”;}
    B:public String getInfo(){}
    C:public void getInfo(){}
    D:public String getInfo(){return null;}
  41. 下面关于类的申明中存在语法错误的选项是( )。

  42. A:public class Text extends String{}
    B:public class Person extends Object{}
    C:public abstract class Person implements Comparable{}
    D:public class Person{}
  43. 下面的程序运行将会输出结果( )。class Person{public Person(){         System.out.println(“***********”);}}class Student extends Person{public Student(){         System.out.println(“+++++++”);}}class Test{         public static void main(String[] args){         new Student();         System.out.println(“=========”);}}

  44. A:+++++++
    =========
    B:+++++++
    ***********
    =========
    C:***********
    +++++++
    =========
    D:=========
  45. 根据语句Word w = new Word(“Java”);可知Word类一定申明了下面的构造方法( )。

  46. A:public word(){}
    B:public void Word(String w){}
    C:public word(String w){}
    D:public Word(String w){}
  47. 运行下面程序将输出结果( )。public class Point{         int x=10;         int y = 10;         public Point(){                   this.x = 30;                   this.y = 30;}public Point move(int dx,  int dy){         this.x += dx;         this.y += dy;         return this;}public String getInfo(){         return “(”+ x + “,” + y +“)”;}public static void main(String[] args){         System.out.println(“Point:” + new Point().move(-10,-10).getInfo());}}

  48. A:Point:(20,20))
    B:Point:(0,0)
    C:Point:(10,10)
    D:Point:(30,30)
  49. 根据语句Student p1=new Student();可以判断下面语句中语法上一定正确的是( )。

  50. A:Object p2 = p1;
    B:Person p2 = new Student();
    C:Student p2 = new Student(“NUFE”);
    D:Person p2 = p1;
  51. 关于方法申明下面选项中没有语法错误的是( )。

  52. A:public int next(){return null;}
    B:public void next(){return null;}
    C:public int[] next(){return null;}
    D:public int[] next(){return {2, 3};}
  53. 已知Person类中有形如Person addFriend(Person p)的方法,下面选项中一定存在语法错误的是( )。

  54. A:this.addFriend(null);
    B:this.addFriend(new Person(“John”)).addFriend(new Person(“Mary”));
    C:this.addFriend(null).addFriend(new Person());
    D:没有
  55. 根据Paper类中的方法申明public static int nextID(){return id;}可以判断下面说法错误的是( )。

  56. A:nextID方法中的return语句等价于return this.id;
    B:nextID方法的执行不依赖于任何Paper对象
    C:语句int id = Paper.nextID();的语法一定是正确的
    D:id一定是静态变量
  57. 下面关于数组变量申明的选项中正确的是( )。

  58. A:int[] data = new int[0];
    B:String[] lines = new String[5];
    C:都正确
    D:String[] persons = {};
  59. 已知Point类的申明如下,下面选项中正确的是( )。public class Point{public void Point(Point p){}public void Point(int x, int y){}}

  60. A:Point p = new Point();
    B:Point p = new Point(2, 10);
    C:Point p = new Point(null);
    D:都正确
  61. 请为以下Report类选择一个正确的方法( )。public class Report{         private String title = “Unknown”;}

  62. A:public static String makeInfo(Report p){return p.title;}
    B:public static String makeInfo(){return new Report().title;}
    C:都正确
    D:public static String makeInfo(String title){return title;}
  63. 根据语句int a=b.length;推测变量b的数据类型可能是( )。

  64. A:int
    B:int[]
    C:String
    D:Integer
  65. 已知Paper类,根据语句System.out.println(Paper.out());从下面选项中为out方法选择一个正确的申明( )。

  66. A:public static String out(){return “******”;}
    B:public String out(){return “******”;}
    C:public void out(){System.out.println(“******”);}
    D:public String out(){System.out.println(“******”);}
  67. 下面选项中一定不可以用作方法public Person getFriend(){}返回语句的是( )。

  68. A:return;
    B:return new Person(“John”);
    C:return this;
    D:return null;
  69. ArrayIndexOutOfBoundsException是( )包中申明的预定义类。

  70. A:java.lang
    B:java.util
    C:java.io
    D:默认包
  71. 用于申明子类的关键字是( )。

  72. A:public
    B:Object
    C:extends
    D:implements
  73. FileNotFoundException的父类是( )。

  74. A:IOException
    B:Exception
    C:RuntimeException
    D:ClassNotFoundException
  75. 已知News类是Document类的一个子类,根据语句n = new News();可以判断变量n的语法类型是( )。

  76. A:Document
    B:News
    C:Object
    D:都可能
  77. 下面选项中一定存在语法错误的是( )。

  78. A:String info = new Person(“John”);
    B:Object obj = new Person(“John”);
    C:Object obj = “Hello,” + new Person(“John”);
    D:String info = “Hello,” + new Person(“John”);
  79. 下面选项中关于super关键字的用法一定错误的是( )。

  80. A:super();
    B:return super;
    C:super(null);
    D:return super.age;
  81. 下面选项中的内容一定会出现在Main.java文件中的是( )。

  82. A:public static void main(String[] args){}
    B:public class main
    C:public static void Main(){}
    D:class Main
  83. 根据以下程序可以判断选项( )没有语法错误。public class Person{         public Person(int id, String name)throws Exception{}}class MyException extends Exception{}

  84. A:public class Test{
    public static void main(String[] args)throws MyException{
    System.out.println(new Person(20, “John”).toString());
    }
    }
    B:public class Test{
    public static void main(String[] args){
    System.out.println(new Person(20, “John”));
    }
    }
    C:public class Test{
    public static void main(String[] args)throws Exception{
    System.out.println(new Person(20, “John”).toString());
    }
    }
    D:public class Test{
    public static void main(String[] args){
    System.out.println(new Person(20, “John”).toString());
    }
    }
  85. 运行下面程序最可能的输出结果是( )。public class Test{public static void main(String[] args){         int[] data = {2, 8, 5};         System.out.println(data);}}

  86. A:0X38DD
    B:[2, 8, 5]
    C:2
    D:2, 8, 5
  87. 关于下面程序的说法正确的是( )。class Person{public Person(String name){}}class Student extends Person{}

  88. A:Person类和Student类都存在语法错误
    B:Person类存在语法错误
    C:Person类和Student类都不存在语法错误
    D:Student类存在语法错误
  89. 下面选项中存在语法错误的是( )。

  90. A:try{int a = 10/0;}catch(NullPointerException e){}catch(ArithmetricException e){}
    B:try{int a = 10/0;}catch(Exception e){}catch(ArithmetricException e){}
    C:try{int a = 10/0;}catch(Exception e){}
    D:try{throw new Exception();}catch(Exception e){}
  91. 下面关于自定义异常的申明中属于非运行时异常的选项是( )。

  92. A:public class MyException extends RuntimeException{}
    B:public class MyException extends String{}
    C:public class MyException extends Exception{}
    D:public class MyException extends NullPointerException{}
  93. 根据Document doc=new News();可以判断选项( )语法上是错误的。

  94. A:News d = doc;
    B:Document d = doc;
    C:News d = (News)doc;
    D:Document d = (News)doc;

温馨提示支付 ¥5.00 元后可查看付费内容,请先翻页预览!
点赞(4) dxwkbang
返回
顶部