Converting an int to a binary string representation in Java?

binary, int, java, string

Solution

Integer.toBinaryString(int i)

Problem

What would be the best way (ideally, simplest) to convert an int to a binary string representation in Java? For example, say the int is 156. The binary string representation of this would be "10011100".

Original source