Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

anon inner class Q from Sierra_Bates exam

 
Jasper Vader
Ranch Hand
Posts: 284
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi there.,.. i understand one answer to this question but the second correct answer, i am still a little fuzzy on...
anyway, here it is...
class Bing {
Bing (String s) {}
Bing() {}
}
class Bang extends Bing {
Bang() {}
Bang(String BangS) { super(BangS);}
//insert code here
}
which two create an anonmous class within Bang?
...the two correct ones were:
Bing b = new Bang() { };
and the one i don't understand - why have "Foo" in quotes, within the curly braces? what does it do? why is it there? if it is an arg, shouldn't it be in the parentheses? and anyway i guess as it is an anonymous class definition, no need for an arg in the parentheses.... so what is it doing?
Bing b = new Bing() { "Foo"; };

....thanks in advance for your help .
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On my manuscript the options are:
A. Bang b = new Bing(String s) { };
B. Bing b = new Bing(343) { };
C. Bing b = new Bing() {String booString; };
D. Bing b = new Bang() { };
E. Bing b = new Bing.Bang(String s) { };
So I don't see any "Foo" String literal anywhere
 
Jimmy Chiu
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jasper Vader:
hi there.,.. i understand one answer to this question but the second correct answer, i am still a little fuzzy on...
anyway, here it is...
class Bing {
Bing (String s) {}
Bing() {}
}
class Bang extends Bing {
Bang() {}
Bang(String BangS) { super(BangS);}
//insert code here
}
which two create an anonmous class within Bang?
...the two correct ones were:
Bing b = new Bang() { };
and the one i don't understand - why have "Foo" in quotes, within the curly braces? what does it do? why is it there? if it is an arg, shouldn't it be in the parentheses? and anyway i guess as it is an anonymous class definition, no need for an arg in the parentheses.... so what is it doing?
Bing b = new Bing() { "Foo"; };

....thanks in advance for your help .

I saw it somewhere in the book, but can't find it now.
 
Paulo Freitas
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could anyone post the complete question with the alternatives?
thanks in advance.
 
Jasper Vader
Ranch Hand
Posts: 284
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Paulo Freitas:
Could anyone post the complete question with the alternatives?
thanks in advance.

actually paul it is on the master exam...and so it is rather a case of...if it comes up again, i will post it, but the questions are random.
valentin - the question isnt in the book, it is in the exam (1st master exam is where i encountered it). maybe there is one similar in the book.
without posting the extra optional incorrect answers, is there anyone who can just tell me what is going on? (it now looks to me maybe like there was a typo in the question or something).
-j
[ March 07, 2003: Message edited by: Jasper Vader ]
 
Sarma Lolla
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jasper,
How many did you get in the master Exam?
 
Jasper Vader
Ranch Hand
Posts: 284
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can't remember... i started making music with Reason half way through. But i am going to do the second master exam properly today, as i have the proper Java cert exam on Monday.
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[hijack]
i started making music with Reason half way through.
Now, that's amazing. I did exactly the same when I was preparing for my exam two years ago. That good old Propellerheads' Reason made me fly while I was learning
[/hijack]
 
Jasper Vader
Ranch Hand
Posts: 284
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aha, so you would have been using Reason 1, which i am on. It's fun, simple, although the new Reason 2.5 looks totally scrumptious (if that's an appropriate term), with the vocoder, and spider CV, and Unison ... very exciting.
Been using Artmatic Pro to create cosmic space animations at dv quality to make a video for a Reason-based track. lots of fun!
anyway, i did the master exam 2, and got 74 percent, which really ain't that bad considering the last computer i programmed was an amiga 1000 15 years ago. .... going to do the third mock exam today (the downloaded one)... hoping to get a slightly better score, as the exam is monday (tomorrow).
 
Bert Bates
author
Sheriff
Posts: 8898
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jasper and Valentin -
Kathy is a BIG 'reason' fan too! (I'm just getting started, but I've been a 'mixer-head' for years.)
She will be excited to know that you guys are in to 'reason' !
-Bert
 
Salvador Cecilio
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found this question on the MasterExam CDROM Open Book Exam.

I have the following as option C.



It doesn't compile on JDK 1.4 and believe that there is only one correct answer even thought the exam software believes that there's two "correct" answers.
[ April 18, 2006: Message edited by: Salvador Cecilio ]
 
Ganesh Pujar
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry!

What is this 'reason' all about???
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Reason Music It looks like its a music software. How good is it, i wonder...
 
Naveen Kollipara
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please continue the discussion of question again.
Dont deviate the topic
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic