About Question enthuware.ocpjp.v8.2.1540 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
dr_astico
Posts: 6
Joined: Thu Dec 29, 2016 5:57 am
Contact:

About Question enthuware.ocpjp.v8.2.1540 :

Post by dr_astico »

Code: Select all

Files.setAttribute(p, "dos:hidden", true, NOFOLLOW_LINKS);
Actually, the code above will not compile as is because "NOFOLLOW_LINKS" will not be resolved.

to make this option valid i have to assume either:

Code: Select all

LinkOption NOFOLLOW_LINK = LinkOption.NOFOLLOW_LINKS;
//Assuming appropriate LinkOption import statement
//a little ugly to read though
or:

Code: Select all

import static java.nio.file.LinkOption.*;
so obviously I have to assume correct imports, in any case.

In every question with code snippets there is a warning about to assume every correct import statements needed.
in this question: nothing, so this misleaded me to think the option was invalid.


my fault. Because these are not a code snippet in the question body: are the answers options,

right?

admin
Site Admin
Posts: 10046
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v8.2.1540 :

Post by admin »

Some questions that may seem to contain full listing explicitly ask you to assume imports only to avoid any confusion. But whenever you see a clearly partial/incomplete code listing, you should always assume appropriate imports.

HTH,
Paul.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 86 guests