• 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

Sybex Java OCP 8 Typo Imports Missing

 
Ranch Hand
Posts: 215
11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are multiple questions that have no line numbers at all and imports are missing.
So at the real exam should I put compile error or pretend that are present?
If there is number 1,2,3,4,5 I certainly put compile error,
BUT if there are no line numbers at all should I put compile error?
 
Marshal
Posts: 8842
631
Mac OS X VI Editor BSD Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Vlad Alin wrote:There are multiple questions that have no line numbers at all and imports are missing.


If I remember well, questions state what you can assume.

If there is number 1,2,3,4,5 I certainly put compile error


What do you mean by those numbers? Line numbers? If yes, these are the way to communicate with candidate, about which part(s) of the code is being talked about. Line numbers are not part of the source code.


Can you give a bit more concrete example.
 
Vlad Alin
Ranch Hand
Posts: 215
11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In OCA Java 8 book says "when you do see the line number 1 or no line numbers at all, you have to make sure imports aren't missing.

Almost all questions have imports when there are no line numbers at all.
So at exam I'll put compile error if imports are missing if there are no numbers.

There are few questions that don't have imports especially on bonus questions. No big deal. Small typo.
For example Bonus Question 86/180 is
What is the result of executing the following application?

class PerfectSquares {
   public static void main(String[] args) {
       ExecutorService service = Executors.newSingleThreadExecutor();
       IntStream.of(1, 4, 9, 16, 25).parallel() // z1
               .forEachOrdered(c -> service.submit( // z2
                       () -> System.out.println(10 * c))); // z3
       service.submit(() -> System.out.println("Complete!")); // z4
       service.shutdown();
   }
}

But it should be

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.stream.IntStream;

class PerfectSquares {
   public static void main(String[] args) {
       ExecutorService service = Executors.newSingleThreadExecutor();
       IntStream.of(1, 4, 9, 16, 25).parallel() // z1
               .forEachOrdered(c -> service.submit( // z2
                       () -> System.out.println(10 * c))); // z3
       service.submit(() -> System.out.println("Complete!")); // z4
       service.shutdown();
   }
}
 
Liutauras Vilda
Marshal
Posts: 8842
631
Mac OS X VI Editor BSD Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You'll go to exam and it will be all explained what to expect and how to interpret questions, what you can assume and what you cannot.

I don't remember myself being confused on how questions were presented. It is explained upfront.
 
reply
    Bookmark Topic Watch Topic
  • New Topic