This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes answers to java.ditmas.net Mock Exam Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "answers to java.ditmas.net Mock Exam" Watch "answers to java.ditmas.net Mock Exam" New topic
Author

answers to java.ditmas.net Mock Exam

Moya Green
Ranch Hand

Joined: Jan 24, 2002
Posts: 49
I did the mock exam provided by http://java.ditmas.net/mocks.htm. Does anyone know where are the updated (corrected) answers to the mock exam? Some of the answers seem to be not right. Or maybe I am wrong.
Thanks!
Jim Petersen
Ranch Hand

Joined: Jul 24, 2001
Posts: 241
Hi Moya
Just to let you know there are some incorrect answers on that site from what I remember when I did the SCJP


- Jim Petersen <br />SCJP2<br />SCWCD<p>- but then again, I could be wrong...
chafule razgul
Ranch Hand

Joined: Feb 09, 2002
Posts: 63
For #43 i have a question
43. What will be the return type of this statement?
(byte)10/10.2*7;
A. short
B. int
C. double
D. float
E. Compilation Error
My question is,the priority of the cast operator, what is actually being casted into byte?
TIA
Curly Bloke
Greenhorn

Joined: Feb 20, 2002
Posts: 1
It returns a double (see http://java.sun.com/docs/books/tutorial/java/nutsandbolts/expressions.html for a summary of operator precedence) as the cast is evaluated before the / and *
chafule razgul
Ranch Hand

Joined: Feb 09, 2002
Posts: 63
Thanks Curly
FYI, questions 50 and 55 have incorrect answers, in my opinion, after trying them out.. Question 32 has options A-D, but the answer is E..
Marcus Howarth
Ranch Hand

Joined: Jan 04, 2002
Posts: 37
I agree
#50 - C: Exception is a subclass of Throwable - not Thread as they seem to think
#55 - Given:

How will you create an instance of static Inner Class? Select 2
a. Inner a= new Inner();
b. Outer o= new Outer();Outer.Inner a= new o.Inner();
c. Outer.Inner a= new Outer.new Inner();
d. Outer.Inner a= new Outer.Inner();

they say B & D.. I would have said B for sure.. when run in the main() but does D work?
# 32 - yeah well.. nice answer! no option E.. I'm about to give up on this test I think.. though good practice! but just to check I've got it

What will be the output?
A. Compilation Error void main Can't return any value.
B. Prints Exception
C. Prints Exception Finally
D. Prints Finally

answer is A right?
PS. can you see the question numbers for the answers? I've had to copy it into a spreadsheet to see them...


Marcus<br /> <br />SCJP, March '02
Erik Dark
Ranch Hand

Joined: Jan 28, 2002
Posts: 107
#55 - Given:

How will you create an instance of static Inner Class? Select 2
a. Inner a= new Inner();
b. Outer o= new Outer();Outer.Inner a= new o.Inner();
c. Outer.Inner a= new Outer.new Inner();
d. Outer.Inner a= new Outer.Inner();

they say B & D.. I would have said B for sure.. when run in the main() but does D work?

Rule: A static member/nested class reference does not need an instance of the enclosing class!
According to this D is ok, B is right although it uses an instance of the Outer class.
Erik Dark
Brian Lugo
Ranch Hand

Joined: Nov 10, 2000
Posts: 165
For #32 correct answer is D.
Are you guys all talking about the same test?, i.e the one at:-
http://java.ditmas.net/mocks.htm
I will make sure I do not go to this web site when I am ready to take mock exams.
Thanks,
Brian
flynn xi
Greenhorn

Joined: Jan 14, 2002
Posts: 8

#55 - Given code:
class Outer{
static class Inner{}
}
How will you create an instance of static Inner Class? Select 2
a. Inner a= new Inner();
b. Outer o= new Outer();Outer.Inner a= new o.Inner();
c. Outer.Inner a= new Outer.new Inner();
d. Outer.Inner a= new Outer.Inner();
they say B & D.. I would have said B for sure.. when run in the main() but does D work?

Just tried choice b: it makes compiler complain about no package o. But if you change "a = new o.Inner()" to "a = o.new Inner()", then no compiler error at all! :roll:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: answers to java.ditmas.net Mock Exam
 
Similar Threads
Need last minute help about io and awt
JCP Questions needed
not cleared
SCJP Exam
error