About Question enthuware.ocpjp.i.v11.2.3071 :

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
kevvvvyp
Posts: 4
Joined: Wed Jun 05, 2019 3:22 pm
Contact:

About Question enthuware.ocpjp.i.v11.2.3071 :

Post by kevvvvyp »

Hi there,

I think the following question in the 1Z0-851 exam is incorrect, the correct answer is listed as "Compilation error at //2" but this should be Compilation error at //1" ?

Q: What will the following code print when compiled and run?

Code: Select all

    public static void main(String args[]) {


        int value = 0;
        Supplier<Integer> valueS = () -> value++; //1
        value++; //2
        System.out.println(value + " " + valueS.get()); //3
    }

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

Re: About Question enthuware.ocpjp.i.v11.2.3071 :

Post by admin »

Yes, you are right. The error should be at //1. Fixed.
thank you for your feedback!
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: Bing [Bot] and 29 guests