A. foo( n -> Integer.toHexString(n) ) is a correct answer because it uses a lambda expression to define the implementation of the Function interface. The lambda expression takes an Integer as input and returns a String as output, which matches the expected input and output types of the Function interface.
F. foo( Integer::toHexString ) is also a correct answer because it uses a method reference to define the implementation of the Function interface. The method reference refers to the toHexString method of the Integer class, which takes an Integer as input and returns a String as output, matching the expected input and output types of the Function interface.
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
ASPushkin
1 week, 2 days agoOmnisumem
5 months agoStavok
6 months agotmuralimanohar
6 months, 2 weeks agoMukes877
7 months, 2 weeks agoObalt
11 months, 2 weeks ago