java convert number to binary code example Example: int to binary java String binary = Integer.toBinaryString(num);