Does BiFunction require two or three parameters?

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

Moderator: admin

Post Reply
dimitrilc
Posts: 35
Joined: Sat Jun 06, 2020 4:51 pm
Contact:

Does BiFunction require two or three parameters?

Post by dimitrilc »

at Kindle Location 8965, the book states that BiFunction takes two parameters, BiFunction <T, R>. But on Java's doc and in the examples(in the book), BiFunction seems to take three parameters. Is this a typo, or is there anything else that I am missing?

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

Re: Does BiFunction require two or three parameters?

Post by admin »

BiFunction takes two parameters. The sentence in the book, " it takes two arguments of type T and U
and returns a result of type R. Its functional method is R apply(T t, U u)" is correct. But book should say BiFunction<T, U, R> instead of BiFunction<T, R>. T and U are parameter types and R is the return type. The missing U is a typo.
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 53 guests