aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes SCJP Mock Tests Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "SCJP Mock Tests" Watch "SCJP Mock Tests" New topic
Author

SCJP Mock Tests

Chris Barrett
Ranch Hand

Joined: Dec 05, 2013
Posts: 237
    
  12

Hi all,

I apologize if this the wrong forum location.
I was running some mock SCJP exams on http://scjptest.com today and was presented with the following question:

Given the code. What is the result?



The possible answers were:
A) Compilation fails.
B) An exception is thrown at runtime.
C) "BeginRunEnd" is printed.
D) "BeginEndRun" is printed.
E) "BeginEnd" is printed.

As I understand it, a and main are going to be separate threads, therefore the output could be "BeginRunEnd" (option C), but could also be "RunBeginEnd" depending on the OS thread process sequence.
Just to be sure, I tried the code on my Mac in Eclipse and about 1 out of 5 times the result was "RunBeginEnd".

I'm wondering on the real exam how many questions are similar to this format - where the answer option is only part of the real answer, or is a 'choose the best possible answer' format?

Cheers!
Chris
Heena Agarwal
Ranch Hand

Joined: Dec 25, 2013
Posts: 261
    
    4
Chris R Barrett wrote:
Given the code. What is the result?



The possible answers were:
A) Compilation fails.
B) An exception is thrown at runtime.
C) "BeginRunEnd" is printed.
D) "BeginEndRun" is printed.
E) "BeginEnd" is printed.

As I understand it, a and main are going to be separate threads, therefore the output could be "BeginRunEnd" (option C), but could also be "RunBeginEnd" depending on the OS thread process sequence.
Just to be sure, I tried the code on my Mac in Eclipse and about 1 out of 5 times the result was "RunBeginEnd".


You're right. The question should have said something along the lines of 'which of the following is a possible output'.
But I would have chosen C cause every other option is not possible.

Chris Barrett
Ranch Hand

Joined: Dec 05, 2013
Posts: 237
    
  12

Hi Heena,

Thank you for the feedback.

Cheers!
Chris
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SCJP Mock Tests