下面显示的代码确实输出:[b][a,b]但是我希望它在输出中打印两行相同的行。importjava.util.*;publicclassTest{staticvoidtest(String...abc){Sets=newTreeSet(String.CASE_INSENSITIVE_ORDER);s.addAll(Arrays.asList("a","b"));s.removeAll(Arrays.asList(abc));System.out.println(s);}publicstaticvoidmain(String[]args){test("A");test("A","C");
我正在尝试用类型注释我的代码,但在涉及集合时我有点困惑。我在PEP484中阅读了一些观点:Note:Dict,List,SetandFrozenSetaremainlyusefulforannotatingreturnvalues.Forarguments,prefertheabstractcollectiontypesdefinedbelow,e.g.Mapping,SequenceorAbstractSet.和Set,renamedtoAbstractSet.ThisnamechangewasrequiredbecauseSetinthetypingmodulemeansset()