南京财经大学
- 根据语句Record[] data = new Record[10];可以断定Record一定是具体类。( )
- 已知a、b均为Point类型的变量并且a.equals(b)的值为true,那么我们可以判断Point类一定覆盖了equals方法。( )
- 一个Java类可以申明一个父类同时实现多个接口。( )
- 表达式new Person()==new Person()的值一定为false。( )
- Java程序只有8种简单数据类型,java.lang包内为每种简单数据类型申明了一个对应的引用数据类型,我们把这些引用数据类型称为封装类。( )
- 语句int a = new Integer(10);在语法上是错误的。( )
- 语句Person[] friends = new Person[10];执行后内存中将增加11个新对象。( )
- 根据申明public class Circle extends Shape{}可知Shape类一定是具体类。( )
- 语句System.out.println(new Person());等价于语句System.out.println(new Person().toStrng());。( )
- InputStreamReader类的作用是用来将字节流转换成字符流。( )
- 在集成开发环境中运行一个Java程序时,不需要对源程序进行编译就可以直接运行。( )
- 在一个Java类中可以申明很多方法,但是运行时不一定都会被执行。( )
- 即使一个抽象类中没有申明任何抽象方法,我们也不可以使用new调用其构造方法来创建对象。( )
- 语句System.out.println(10 + 10 +“hello”+ 10 + 10);运行后将输出1010hello1010。( )
- 语法上正确的程序一定能够正确运行结束。( )
- 根据如下给定的部分部分片段可以得出结论( )。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());}}
- 根据如下程序选择正确的说法( )。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());}}
- 运行下面程序将输出结果( )。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());}}
- 用于从文件中读取字符内容的类是( )。
- 根据语句String info=getInfo();选择正确的getInfo方法( )。
- 下面关于类的申明中存在语法错误的选项是( )。
- 下面的程序运行将会输出结果( )。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(“=========”);}}
- 根据语句Word w = new Word(“Java”);可知Word类一定申明了下面的构造方法( )。
- 运行下面程序将输出结果( )。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());}}
- 根据语句Student p1=new Student();可以判断下面语句中语法上一定正确的是( )。
- 关于方法申明下面选项中没有语法错误的是( )。
- 已知Person类中有形如Person addFriend(Person p)的方法,下面选项中一定存在语法错误的是( )。
- 根据Paper类中的方法申明public static int nextID(){return id;}可以判断下面说法错误的是( )。
- 下面关于数组变量申明的选项中正确的是( )。
- 已知Point类的申明如下,下面选项中正确的是( )。public class Point{public void Point(Point p){}public void Point(int x, int y){}}
- 请为以下Report类选择一个正确的方法( )。public class Report{ private String title = “Unknown”;}
- 根据语句int a=b.length;推测变量b的数据类型可能是( )。
- 已知Paper类,根据语句System.out.println(Paper.out());从下面选项中为out方法选择一个正确的申明( )。
- 下面选项中一定不可以用作方法public Person getFriend(){}返回语句的是( )。
- ArrayIndexOutOfBoundsException是( )包中申明的预定义类。
- 用于申明子类的关键字是( )。
- FileNotFoundException的父类是( )。
- 已知News类是Document类的一个子类,根据语句n = new News();可以判断变量n的语法类型是( )。
- 下面选项中一定存在语法错误的是( )。
- 下面选项中关于super关键字的用法一定错误的是( )。
- 下面选项中的内容一定会出现在Main.java文件中的是( )。
- 根据以下程序可以判断选项( )没有语法错误。public class Person{ public Person(int id, String name)throws Exception{}}class MyException extends Exception{}
- 运行下面程序最可能的输出结果是( )。public class Test{public static void main(String[] args){ int[] data = {2, 8, 5}; System.out.println(data);}}
- 关于下面程序的说法正确的是( )。class Person{public Person(String name){}}class Student extends Person{}
- 下面选项中存在语法错误的是( )。
- 下面关于自定义异常的申明中属于非运行时异常的选项是( )。
- 根据Document doc=new News();可以判断选项( )语法上是错误的。
A:对 B:错
答案:错
A:错 B:对
答案:错
A:错 B:对
答案:对
A:错 B:对
答案:对
A:错 B:对
答案:对
A:对 B:错
答案:错
A:对 B:错
答案:错
A:对 B:错
答案:错
A:对 B:错
答案:A:对
A:对 B:错
A:错 B:对
A:错 B:对
A:错 B:对
A:错 B:对
A:错 B:对
A:Circle类一定有toString方法
B:Circle类一定显式申明了形如Circle(Point p, double d)的构造方法
C:Circle类覆盖了父类中的getInfo方法
D:Circle类是Point类的子类
A:p2.getInfo()得到的结果是(12, 0)
B:p1.getInfo()得到的结果是(0, 0)
C:程序总共创建了1个Point对象
D:p2.getInfo()得到的结果是(0, 0)
A:Point:(10,10)
B:Point:(30,30)
C:Point:
D:Point:null
A:InputStream
B:FileReader
C:Reader
D:FileInputStream
A:public void getInfo(){return “Hello World”;}
B:public String getInfo(){}
C:public void getInfo(){}
D:public String getInfo(){return null;}
A:public class Text extends String{}
B:public class Person extends Object{}
C:public abstract class Person implements Comparable{}
D:public class Person{}
A:+++++++
=========
B:+++++++
***********
=========
C:***********
+++++++
=========
D:=========
A:public word(){}
B:public void Word(String w){}
C:public word(String w){}
D:public Word(String w){}
A:Point:(20,20))
B:Point:(0,0)
C:Point:(10,10)
D:Point:(30,30)
A:Object p2 = p1;
B:Person p2 = new Student();
C:Student p2 = new Student(“NUFE”);
D:Person p2 = p1;
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};}
A:this.addFriend(null);
B:this.addFriend(new Person(“John”)).addFriend(new Person(“Mary”));
C:this.addFriend(null).addFriend(new Person());
D:没有
A:nextID方法中的return语句等价于return this.id;
B:nextID方法的执行不依赖于任何Paper对象
C:语句int id = Paper.nextID();的语法一定是正确的
D:id一定是静态变量
A:int[] data = new int[0];
B:String[] lines = new String[5];
C:都正确
D:String[] persons = {};
A:Point p = new Point();
B:Point p = new Point(2, 10);
C:Point p = new Point(null);
D:都正确
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;}
A:int
B:int[]
C:String
D:Integer
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(“******”);}
A:return;
B:return new Person(“John”);
C:return this;
D:return null;
A:java.lang
B:java.util
C:java.io
D:默认包
A:public
B:Object
C:extends
D:implements
A:IOException
B:Exception
C:RuntimeException
D:ClassNotFoundException
A:Document
B:News
C:Object
D:都可能
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”);
A:super();
B:return super;
C:super(null);
D:return super.age;
A:public static void main(String[] args){}
B:public class main
C:public static void Main(){}
D:class Main
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());
}
}
A:0X38DD
B:[2, 8, 5]
C:2
D:2, 8, 5
A:Person类和Student类都存在语法错误
B:Person类存在语法错误
C:Person类和Student类都不存在语法错误
D:Student类存在语法错误
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){}
A:public class MyException extends RuntimeException{}
B:public class MyException extends String{}
C:public class MyException extends Exception{}
D:public class MyException extends NullPointerException{}
A:News d = doc;
B:Document d = doc;
C:News d = (News)doc;
D:Document d = (News)doc;
温馨提示支付 ¥5.00 元后可查看付费内容,请先翻页预览!