在Java的TreeSet中,如何获取集合中所有小于给定元素的元素组成的子集? A. 使用headSet(E toElement)方法 B. 使用tailSet(E fromElement)方法 C. 使用subSet(E from, E to)方法 D. 使用lower(E e)方法 答案解析 headSet(E toElement)方法返回此集合的子集,由小于toElement的元素组成。这正好符合题目要求。 正确答案:A