下列修饰符能够修饰类的是
A. protect
B. private
C. protected
D. public
给定一个Java程序的代码如下所示,则编译运行后,输出结果是public class Test {int count = 9;public void count() {System.out.print("count=" + (count++)+" ");}public static void main(String args[]) {new Test().count();new Test().count();}}
A. count=9 count=9
B. count=10 count=9
C. count=10 count=10
D. count=9 count=10
能与public void methodA(){ }形成重载的有
A. private void methodA(){ }
B. private int methodA(){ return 1;}
C. public void methodA(int a){ }
D. public void methodA() throws Exception{ }
阅读下面代码,将会输出public class Testa {Integer a = new Integer(10);Integer b = new Integer(10);public static void main (String[ ] args){Testa testA = new Testa();if (testA.a==testA.b){System.out.print("很");}if (testA.a.equals(testA.b)){System.out.print("好");}} }
A. 很
B. 好
C. 很好
D. 抛出NullPointerException异常