aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes anon inner class Q from Sierra_Bates exam Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "anon inner class Q from Sierra_Bates exam" Watch "anon inner class Q from Sierra_Bates exam" New topic
Author

anon inner class Q from Sierra_Bates exam

Jasper Vader
Ranch Hand

Joined: Jan 10, 2003
Posts: 284
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 .


giddee up
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
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


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Jimmy Chiu
Ranch Hand

Joined: Feb 08, 2003
Posts: 58
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.


go...
Paulo Freitas
Greenhorn

Joined: Feb 26, 2003
Posts: 17
Could anyone post the complete question with the alternatives?
thanks in advance.
Jasper Vader
Ranch Hand

Joined: Jan 10, 2003
Posts: 284
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

Joined: Oct 21, 2002
Posts: 203
Jasper,
How many did you get in the master Exam?
Jasper Vader
Ranch Hand

Joined: Jan 10, 2003
Posts: 284
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

Joined: Aug 26, 2001
Posts: 7610
[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

Joined: Jan 10, 2003
Posts: 284
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

Joined: Oct 14, 2002
Posts: 8829
    
    5
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


Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
Salvador Cecilio
Ranch Hand

Joined: Dec 20, 2004
Posts: 41
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 ]

SCJP 1.4 - 93%
SCWCD 1.4 - 89%
IBM FileNet 3.5 - Developer
IBM FileNet 3.5 - Administrator
Ganesh Pujar
Ranch Hand

Joined: Mar 22, 2006
Posts: 45
Sorry!

What is this 'reason' all about???
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

Reason Music It looks like its a music software. How good is it, i wonder...


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Naveen Kollipara
Ranch Hand

Joined: Feb 20, 2006
Posts: 32
Please continue the discussion of question again.
Dont deviate the topic


Regards,<br />Naveen<br />SCJP 5 - 83%<br />SCWCD - 84%
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: anon inner class Q from Sierra_Bates exam