Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

anon inner class Q from Sierra_Bates exam

 
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 .
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • 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
 
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.
 
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 ]
 
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
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • 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).
 
author
Posts: 9000
19
  • 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
 
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 ]
 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry!

What is this 'reason' all about???
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • 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...
 
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
 
Amateurs built google. Professionals built the titanic. We can't find the guy that built this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic