Before we can do anything String-specific with that retrieved value, we have to cast it to a String, even when the retrieved element was added in the same code block!
To specify an int variable for an iterator and a String variable for element name, use the code in Listing 17.
要为迭代器指定一个int变量并为元素名称指定一个String变量,请使用清单17中的代码。
3
The call to filter converts the string that is passed as its second argument to a piece of code, which it then applies to each element of the list that is passed as its first argument.