• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Mock exam 3 Question 48 on OCP Oracle Certified Professional Java SE8 Programmer II Study Guide

 
Ranch Hand
Posts: 62
4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

I noticed a typo error on a question in one of the mock exam questions in the book: OCP Oracle Certified Professional Java SE8 Programmer II Study Guide by Jeanne Boyarsky and Scott Selikoff.

tb067900.JaSE8PrgIISG.be3.48. What is the result of executing the following application? (Choose all that apply.)



A. It outputs Salad bar empty exactly once.
B. It outputs Salad bar empty multiple times.
C. The code will not compile because of line r1.
D. The code will not compile because of line r2.
E. The code will not compile because of line r3.
F. It compiles but throws an exception at runtime.
G. It compiles but waits forever at runtime.

The answer is as follows:
The code compiles without issue, so C, D, and E are incorrect. The limit of the cyclic barrier is 4, and since we are sending 12 tasks to it, it is activated a total of three times. Therefore, B is the correct answer, and A, F, and G are incorrect. Note that the thread pool is also 4, which means that we have just enough threads to break the barrier. For example, if our thread pool was 3, then the barrier would never be reached and G would be the correct answer.

The correct answer is only option B, not multi choice so I think should be removed (Choose all that apply.).
The choice type was radio-button(choose only one) in the question.
 
author & internet detective
Posts: 42135
937
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes. We learned after writing the book than the online engine makes it a radio button when there is only one option and therefore you can't have "choose all that apply" questions with one answer. We wrote a static analysis rule for that so the problem doesn't appear in the Java 11 or 17 versions.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic