Im having this issue which I dont understand. Any advice?
-
4Please don't put screenshots of code on StackExchange! No one having the same issue will be able to find this page later by searching on this site, e.g. using the keyword "split". This is just one of the many reasons code should be provided as text here. (The return value of split(...) in your line four is necessarily a List of Strings, which is a very different animal from a List of Orders.) You can't assign one to the other.– Felix van HoveMar 28 at 21:06
1 Answer
The error tells you exactly what is wrong, as does the documentation on the String.split
method. It returns List<String>
, not List<Order>
.
Incorrect
List<Order> values = myString.split(delimiter);
Correct
List<String> values = myString.split(delimiter);