题目内容

匿名类一定是内部类吗?回答是或者否________。

查看答案
更多问题

可以把_______类定义成static类。

请说出下列程序的输出结果____________。class Cry {public void cry() {System.out.println("大家好");}}public class E {public static void main(String args[]) {Cry hello=new Cry() {public void cry() {System.out.println("Hello");}};hello.cry();}}

请说出下列程序的输出结果_____________,_____________。import java.io.IOException;public class E {public static void main(String args[]){try { methodA();}catch(IOException e){System.out.print("你好");return;}finally {System.out.println("thanks");}}public static void methodA() throws IOException{throw new IOException();}}

请说出下列程序的输出结果____________。该程序共产生_______个.class 文件。class RedCowForm {static class RedCow { //静态内部类是外嵌类中的一种静态数据类型void speak() {System.out.println("我是红牛");}}}class BlackCowForm {public static void main(String args[]) {RedCowForm.RedCow red =new RedCowForm.RedCow(); //如果RedCom不是静态内部类,此代码非法red.speak();}}

答案查题题库