1. 给定java程序,如下: public class Test{ private static final int counter=10; public static void main(String [] args){ System.out.println(++counter); } } 编译运行Test.java,结果是 () A. 10 B. 11 C. 编译错误 D. 运行时出现异常 2. 给定两个java程序,如下: public interface Face{ int counter = 40; } public class Test implements Face{ private static int counter; public static void main(String[]args){ System.out.println(++counter); } } Test.java 的编译运行结果是( )。 A. 40 B. 41 C. 0 D. 1
|