Thanks in advance for any help.....
I am using the MasterExam from LearnKey CD included with the Osbourne Study guide by Sierra and Bates. Here is the question:
class Bing{
Bing(
String s) {}
Bing(){}
}
class Bang extends Bing{
Bang(){}
Bang(String bangS){super(bangS);}
//insert code here
}
which two create an anonymous inner class from within class Bang (choose two)?
[A] Bang b = new Bing("Foo"){};
[B] Bing b = new Bing(343){};
[C] Bing b = new Bing(){"Foo";};
[D] Bing b = new Bang(){};
[E] Bing b = new Bing.Bang("Foo"){};
They say the answer is C and D. I contend that only D is correct, and that C results in a compilation error. I am almost certain - I have even compiled to verify.But.....
grrrr.....I hate it when the
test answers are wrong - makes me worried about the quality of the actual test.
Can someone please verify the correct answer...
Thanks
:roll: