![]() |
VOOZH | about |
TreeSet class, the contains() method is utilized to check if an element is present in the TreeSet of not.
Method Definition: def contains(elem: A): Boolean Return Type: It returns true if the element is present in the TreeSet or else it returns false.Example #1:
TreeSet(1, 12, 23, 41, 43, 72) TreeSet contains '10': false
TreeSet(e, g, k, s) TreeSet contains 'k': true