Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Introduction to Functional Programming Functional Programming Fundamentals Function Composition

Andrey Serebryanskiy
Andrey Serebryanskiy
5,756 Points

When using andThen function does not returns String for some reason

Hi!

In the second FixMe I wrote this line:

homeValueIndex -> usdToArgentinePesoConverter.andThen(argentineCurrencyFormatter));

However, for some reason it returns ?extends<V> istead of String. Here is a screenshot of what exactly IntelliJ writes if I hover on the error:

I made no changes to other code in the challenge.

Can you please explain me, what am I doing wrong?

Thank you in advance.

1 Answer

Hello Andrey,

First drop the lambda, see the variable "homeValueIndex " is not being used so, it is better to just pass the function reference that you already have.

Check this:

usdToArgentinePesoConverter.andThen(argentineCurrencyFormatter)

Regards

Andrey Serebryanskiy
Andrey Serebryanskiy
5,756 Points

Thank you very much, it helped and I understood my mistake)