• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SCJP Mock Tests

 
Chris Barrett
Bartender
Pie
Posts: 317
24
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 262
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Pie
Posts: 317
24
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Heena,

Thank you for the feedback.

Cheers!
Chris
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic