关于抽象方法描述正确的是
A. 可以有方法体
B. 可以出现在非抽象类中
C. 没有方法体的方法
D. 抽象类中的方法都是抽象方法
public class Test{public static void main(String[] args){int[] A = new int[]{1,2,3,4,5,6,7,8,9};int[] B = Test.reverse(A);}public static int[] reverse(____(1)____){for(int i=0;____ (2)______;i++){int temp = A[A.length-i-1];_______(3)_____;A[i] = temp;}return A;}}
class MNA {private void f() {}class A {private void g() {}public class B {void h() {g();f();}}}}public class MultiNestingAccess {public static void main(String[] args) {MNA mna = _____(1)____; //生成MNA类的实例MNA.A mnaa = ____(2)______; //生成A类的实例MNA.A.B mnaab = __(3)______; //生成B类的实例____(4)____; //调用方法h()}}
请写出以下程序在控制台的输出。class Super{static String greeting(){ return "Good night"; }String name(){ return "Tom"; }}class Sub extends Super{static String greeting(){ return "Hello"; }String name(){ return "Mary"; }}public class test{public static void main(String[] args){Super s = new Sub();System.out.println( s.greeting() +"," + s.name() );}}