• 2022-07-24
    以下抽象类的定义中,错误的是?
    A: abstract class Demo1{}
    B: abstract class Demo2{ public abstract String fun(String a); }
    C: abstract class Demo3{ public String fun(){ return \
    D: abstract class Demo4{ public static final String CZBK = \高等教育 \
  • D

    举一反三

    内容

    • 0

      下列哪个类声明是正确的 ( ) A: A) abstract class G2 extends superClass1, superClass2 … B: B) abstract public class classmates… C: C) public final class NewClass extends superClass implemnets Interfacel… D: D) public abstract class String…

    • 1

      给定代码如下: public abstract interface Frobnicate { public void twiddle(String s); } 以下哪个类是正确的?(). A: public abstract class Frob implements Frobnicate { public abstract void twiddle(String s) { } } B: public abstract class Frob implements Frobnicate { } C: public class Frob extends Frobnicate { public void twiddle(Integer i) { } } D: public class Frob implements Frobnicate { public void twiddle(Integer i) { } }

    • 2

      (7-1)以下程序的运行结果是( )。 class A{ A(){ System.out.print(10); } } public class Demo extends A { public static void main(String[] args) { new A(); new Demo(); } }

    • 3

      {下面程序编译运行的结果是( )class Demo <;T>; {void setData(T a){System.out.print(a);};}public class Demo2015 {public static void main(String&#91;&#93;a){Demo<;String>; d = new Demo<;String>;();d.setData("a");d.setData(1);}}} A: a B: 1 C: a1 D: 编译错误

    • 4

      6、阅读下列代码,构造方法()可以存在于上述Demo类中。public class Demo{......Demo(){}......} A: public Demo(){} B: private Demo(){} C: public Demo( int age ){} D: String name(){}