package chess4j.hash;


public class DecimalToBinaryString {

	public static String integerToBinary(int num) {
		String s = Integer.toBinaryString(num);
		int padLength=32-s.length();
		StringBuilder pad = new StringBuilder();
		for (int i=0;i<padLength;i++) {
			pad.append("0");
		}
		return pad + s;
	}
	
	public static void main(String[] args) {
		int number = -256;
		System.out.print("Integer " + number + " = ");
		System.out.println(integerToBinary(number));
	}
} 
