多项选择题
A. The default constructor initializes method variables.
B. The default constructor has the same access as its class.
C. The default constructor invoked the no-arg constructor of the superclass.
D. If a class lacks a no-arg constructor, the compiler always creates a default constructor.
E. The compiler creates a default constructor only when there are no other constructors for the class.
多项选择题 1.classTestA{ 2.TestBb; 3.TestA(){ 4.b=newTestB(this); 5.} 6.} 7.classTestB{ 8.TestAa; 9.TestB(TestAa){ 10.this.a=a; 11.} 12.} 13.classTestAll{ 14.publicstaticvoidmain(Stringargs[]){ 15.newTestAll().makeThings(); 16.//...codecontinueson 17.} 18.voidmakeThings(){ 19.TestAtest=newTestA(); 20.} 21.} Whichtwostatementsaretrueafterline15,beforemaincompletes?()
单项选择题 public class X { public static void main(String [] args) { try { badMethod(); System.out.print(“A”); } catch (Exception ex) { System.out.print(“B”); } finally { System.out.print(“C”); } System.out.print(“D”); } public static void badMethod() { throw new RuntimeException(); } } What is the result? ()
多项选择题 WhichtwoallowtheclassThingtobeinstantiatedusingnewThing()?