此题为判断题(对,错)。
第1题:
abstract class Something {
private abstract String doSomething ();
}
这好像没什么错吧?
错。abstract 的methods 不能以private 修饰。abstract 的methods 就是让子类implement(实
现)具体细节的,怎么可以用private 把abstract
method 封锁起来呢? (同理,abstract method 前不能加final)。
第2题:
此题为判断题(对,错)。
第3题:
设有程序如下: public class jzh0319 { public static void main(String args[]) { subClass sc=new subClass(); } } class superClass { superClass() { System.out.println("父类");} } class subClass extends superClass { subClass() {System.out.println("子类"); } } 其输出结果的第一行是子类。()
此题为判断题(对,错)。
第4题:
此题为判断题(对,错)。
第5题:
此题为判断题(对,错)。
第6题:
此题为判断题(对,错)。
第7题:
此题为判断题(对,错)。
第8题:
此题为判断题(对,错)。
第9题:
此题为判断题(对,错)。
第10题:
此题为判断题(对,错)。
第11题:
abstract class A { abstract void al(); void a2() { } } class B extends A { void a1() { } void a2() { } } class C extends B { void c1() { } } and: A x = new B(); C y = new C(); A z = new C(); Which four are valid examples of polymorphic method calls?()
第12题:
AnAdapter1 aa = new AnAdapter1 () {}
AnAdapter0 aa = new AnAdapter0 () {}
AnAdapter0 aa = new AnAdapter0 (5) {}
AnAdapter1 aa = new AnAdapter1 (5) {}
AnInterface ai = new Anlnterface (5)) {}
第13题:
此题为判断题(对,错)。
第14题:
设有程序如下: public class jzh0319 { public static void main(String args[]) { subClass sc=new subClass(); } } class superClass { superClass() { System.out.println("父类");} } class subClass extends superClass { subClass() {System.out.println("子类"); } } 其输出结果只有一行。()
此题为判断题(对,错)。
第15题:
此题为判断题(对,错)。
第16题:
此题为判断题(对,错)。
第17题:
此题为判断题(对,错)。
第18题:
设有程序如下: abstract class absclass { abstract void method1(); } class conclass extends absclass { public void method1() { System.out.println("子类");} } public class mainclass { public static void main(String args[]) { absclass ac1=new absclass(); //语句1 absclass ac2=new conclass(); //语句2 ac2.method1(); //语句3 } } 则main()方法中的第一条语句(即语句1)可以顺利通过编译。()
此题为判断题(对,错)。
第19题:
此题为判断题(对,错)。
第20题:
此题为判断题(对,错)。
第21题:
此题为判断题(对,错)。
第22题:
此题为判断题(对,错)。
第23题:
AnInterface is an interface. AnAdapter0 is a non-abstract, non-final class with a zero argument constructor. AnAdapter1 is a non-abstract, non-final class without a zero argument constructor, but with a constructor that takes one int argument. Which two construct an anonymous inner class?()