I am unable to complete this Trailhead Module: Get Hands-On with an Iterable Variable in For Loops, because I keep getting this error message:
The constructor MyIterable should accept parameter of type List<String>.
Here's my MyIterable Class with its constructor accepting the correct type of parameter:
public class MyIterable implements Iterable<String> { private List<String> strings; public MyIterable(List<String> strList) { strings = strList; strings.iterator(); } public Iterator<String> iterator() { return strings.iterator(); } }
public MyIterable(List<String> strings)as per the instructions