题目内容

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() );}}

请写出以下程序在控制台的输出。interface InTest{ void testPrintln(); void lambda(); }class Outer implements InTest{public void testPrintln(){ System.out.println("One"); }public void lambda(){ System.out.println("Outer"); testPrintln(); }}public class TestInner {static class Inner extends Outer{public void testPrintln(){ System.out.println("Two"); }public void lambda(){ System.out.println("Inner" ); testPrintln(); }}public static void main(String[]args){InTest tmp =new Outer();tmp.lambda();tmp=new Inner(); tmp.lambda();tmp =new Outer(){public void testPrintln(){ System.out.println("Three");}public void lambda(){System.out.println("Annoy" );super.testPrintln();}};tmp.lambda();}}

请写出下面程序的运行结果class A {public A() {System.out.print("1");}static { System.out.print("2"); }}class B extends A {public B() {System.out.print("3");}static { System.out.print("4"); }}public class test {public static void main(String[] args) {new B();}}

答案查题题库