All pastes #479526 Raw Edit

Mine

public java v1 · immutable
·published 2007-05-09 19:59 UTC
rendered paste body
public class WWJ {	public static void main(String[] args) {		int bval = (1 << 5);  // 5. Bit prüfen		for (int i = 0; i < 10000; i++) {			if ((i & bval) == bval)				System.out.println(toBinaryString(i));		}	}	public static String toBinaryString (int value) {		if (value < 1) 			return "0";				StringBuffer sb = new StringBuffer();				for (int i = 31; i != 0; i--) {				sb.append(isBitSet(value, i) ? '1' : '0');			}				return sb.substring(sb.indexOf("1"));	}		public static boolean isBitSet (int value, int n) { 		return (value & (1 << n)) == (1 << n); 	}	}