• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question Error?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:
 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Bob,
I also took the master exam today and to my surprise, i found another question's solution was also wrong. I don't have the question with me, right in this PC, but itz a question based on method overriding and none of the options really matched the answer. I took a wrong one without any way to go. (answer would be a string outputting PC.....EC something)
And in the final, it striked back saying wrong. Infact, a neat explanation with the correct answer referred to a wrong option is given.
~ Shalini
 
Beauty is in the eye of the tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic