Skip to content
Advertisement

Return all possible combinations of two custom type lists in java

I am trying to add the values of ingredients and topping to my scoops list, but that doesn’t work due to the type of scoops. I can’t change the type of scoops to String and I need to solve the problem as it is in the code below. See the picture to see the problem I get when I try to add values to the list.

JavaScript

Advertisement

Answer

You are very close. One line to change.

JavaScript

instead of

JavaScript

You need a ‘full’ IceCream object to add to the scoops object. But your code constructed a description as a String.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement