Which two declarations prevent the overriding of a method?() A、 Final void methoda() {}B、 Void final methoda() {}C、 Static void methoda() {}D、 Static final void methoda() {}E、 Final abstract void methoda() {}

题目

Which two declarations prevent the overriding of a method?() 

  • A、 Final void methoda() {}
  • B、 Void final methoda() {}
  • C、 Static void methoda() {}
  • D、 Static final void methoda() {}
  • E、 Final abstract void methoda() {}
参考答案和解析
正确答案:A,D
如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

Which two are valid declarations within an interface definition?() 

  • A、 void methoda();
  • B、 public double methoda();
  • C、 public final double methoda();
  • D、 static void methoda(double d1);
  • E、 protected void methoda(double d1);

正确答案:A,B

第2题:

哪二种声明防止方法覆盖?()

  • A、final void methoda() {}
  • B、void final methoda() {}
  • C、static void methoda() {}
  • D、static final void methoda() {}
  • E、final abstract void methoda() {}

正确答案:A,D

第3题:

Which will declare a method that is available to all members of the same package and be referenced without an instance of the class?()

  • A、 abstract public void methoda ();
  • B、 public abstract double inethoda ();
  • C、 static void methoda (double dl) {}
  • D、 public native double methoda () {}
  • E、 protected void methoda (double dl) {}

正确答案:C

第4题:

public class test (      private static int j = 0;  private static boolean methodB(int k) (  j += k;  return true;  )  public static void methodA(int  i)(  boolean b:     b = i < 10 | methodB (4);  b = i < 10 || methodB (8);  )  public static void main (String args[])(   methodA (0);  system.out.printIn(j);  )  )   What is the result?()  

  • A、 The program prints “0”
  • B、 The program prints “4”
  • C、 The program prints “8”
  • D、 The program prints “12”
  • E、 The code does not complete.

正确答案:B

第5题:

public class OuterClass {   private double d1 1.0;   //insert code here   }   You need to insert an inner class declaration at line2. Which two inner class declarations are valid?()

  • A、 static class InnerOne {  public double methoda() {return d1;}  }
  • B、 static class InnerOne {  static double methoda() {return d1;}  }
  • C、 private class InnerOne {  public double methoda() {return d1;}  }
  • D、 protected class InnerOne {  static double methoda() {return d1;}  }
  • E、 public abstract class InnerOne {  public abstract double methoda();  }

正确答案:C,E

第6题:

在接口中以下哪条定义是正确的?()

  • A、void methoda();
  • B、public double methoda();
  • C、public final double methoda();
  • D、static void methoda(double d1);
  • E、protected void methoda(double d1);

正确答案:A,B

第7题:

可以限制一个方法重载的声明语句有()。

  • A、final void methoda(){}
  • B、void final methoda(){}
  • C、static final void methoda(){}
  • D、static void methoda(){}
  • E、final abstract void methoda(){}

正确答案:A,C

第8题:

Which declarations will allow a class to be started as a standalone program?()  

  • A、public void main(String args[])
  • B、public void static main(String args[])
  • C、public static main(String[] argv)
  • D、final public static void main(String [] array)
  • E、public static void main(String args[])

正确答案:D,E

第9题:

Which will declare the method that forces a subclass to implement it?()

  • A、 public double methoda ():
  • B、 static void methoda(double d1) {}
  • C、 public native double methoda ():
  • D、 abstract public foid methoda ():
  • E、 protected void methoda (double d1) {}

正确答案:D

第10题:

1. public class OuterClass {  2. private double d1 = 1.0;  3. // insert code here  4. }  Which two are valid if inserted at line 3?()  

  • A、 static class InnerOne { public double methoda() { return d1; } }
  • B、 static class InnerOne { static double methoda() { return d1; } }
  • C、 private class InnerOne { public double methoda() { return d1; } }
  • D、 protected class InnerOne { static double methoda() { return d1; } }
  • E、 public abstract class InnerOne { public abstract double methoda(); }

正确答案:C,E

更多相关问题