• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

SCJP Mock Tests

 
Bartender
Posts: 322
24
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 262
4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 322
24
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Heena,

Thank you for the feedback.

Cheers!
Chris
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic