(BitSet b)
| 7 | |
| 8 | public class Bits { |
| 9 | public static void printBitSet(BitSet b) { |
| 10 | System.out.println("bits: " + b); |
| 11 | StringBuilder bbits = new StringBuilder(); |
| 12 | for(int j = 0; j < b.size() ; j++) |
| 13 | bbits.append(b.get(j) ? "1" : "0"); |
| 14 | System.out.println("bit pattern: " + bbits); |
| 15 | } |
| 16 | public static void main(String[] args) { |
| 17 | Random rand = new Random(47); |
| 18 | // Take the LSB of nextInt(): |