我有一个方法getListOfTgs(),它也返回一个set. 我有一个方法getListOfClass(),它也返回一个set.
我try 使用forEach方法将它们组合在一起:
scraper.getListOfTags(globalDocument).forEach(tag -> tagsAndClasses.add(tag));
scraper.getListOfClasses(globalDocument).forEach(class -> tagsAndClasses.add(class));
On the second forEach, the class variable name gets underlined and I get this error :
Syntax error on token "class", invalid TypeElidedFormalParameter
When I change the variable name to e.g. classes the problem goes away.
Why is it that I cant name my variable "class"?