About Question enthuware.ocpjp.v11.2.3081 :

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

Moderator: admin

Post Reply
Antonicaalex
Posts: 2
Joined: Fri Nov 27, 2020 2:41 pm
Contact:

About Question enthuware.ocpjp.v11.2.3081 :

Post by Antonicaalex »

What s the difference between

Code: Select all

DoubleStream.generate(Random::nextDouble).limit(10).forEach(System.out::print);
[size=85]nextDouble() is an instance method of Random. So, Random::nextDouble is incorrect here.[/size]
And the

Code: Select all

 slist.forEach(Student::debug);
The debug method is instance method as well

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

Re: About Question enthuware.ocpjp.v11.2.3081 :

Post by admin »

There is no instance of Random available in the context on which nextDouble can be invoked.

But inside foreach, there is an instance of Student available on which debug can be invoked.

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests