Java BitSet.valueOf(long[] longs)

Syntax

BitSet.valueOf(long[] longs) has the following syntax.

public static BitSet valueOf(long[] longs)

Example

In the following code shows how to use BitSet.valueOf(long[] longs) method.


import java.util.BitSet;
/*w w w  . j  a  va  2s.c  om*/
public class Main {

   public static void main(String[] args) {

      BitSet bitset1 = BitSet.valueOf(new long[]{1L,2L,3L});

      // print the sets
      System.out.println("Bitset1:" + bitset1);

   }
}

The code above generates the following result.