Online Java Compiler By
JavaTpoint.com
import java.util.BitSet; public class BitSetToLongArrayExample2 { public static void main(String[] args) { BitSet bitset = new BitSet(); bitset.set(0); bitset.set(1); bitset.set(3); bitset.set(5); bitset.set(6); bitset.set(8); bitset.set(9); bitset.set(64); bitset.set(65); System.out.println("bitset: "+bitset); long[] lngArray = bitset.toLongArray(); for(int i=0;i
Output