Online Java Compiler By
JavaTpoint.com
import java.util.*; public class HashSetspliteratorExample2 { public static void main(String[] args) { HashSet
hashSetObject = new HashSet <>(); hashSetObject.add(45); hashSetObject.add(-67); hashSetObject.add(98); int s = hashSetObject.spliterator(); System.out.println("spliterator of HashSet is: "+s); } }
Output