Via 由 [ ] 提供

abstract 相关问题



  1. A class with no methods
  2. A class with no concrete subclasses
  3. A class with at least one undefiend message
  4. None of above

答案是 4 我们是可以定义一个抽象空类的

abstract class emptyAb {}


abstract class Base{
    abstract public void myfunc();

public class Abs extends Base{
    public static void main(String argv[]){
        Abs a = new Abs();

    public void amethod(){
        System.out.println("A method");


  1. 输出 A method
  2. The code will compile but complain at run time
  3. The compiler will complain errors in Abs class

答案是 3

上一篇: 抽象 abstract 下一篇: this() 和 super(...