Java TreeSet Spliterator() MethodThe spliterator() method of TreeSet class is used to split the set elements and iterate them one by one. Syntax:Return:It returns the spliterator elements of the set. Example 1Output: TreeSet: [4, 6, 9, 12, 18] Elements of TreeSet after using spliterator() method: 4 6 9 12 18 Example 2Output: Elements in TreeSet: shristee vishwakarma Analyst shweta singh Accountant suman chandra Computer Engineer Elements of TreeSet after using spliterator() method: shristee vishwakarma Analyst shweta singh Accountant suman chandra Computer Engineer Next TopicJava-treeset-subset-method |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India