Integer.toBinaryString method
package app;
public class Main
{
public static void main(String[] args)
{
int decimalNumber = 20;
String binaryString = Integer.toBinaryString(decimalNumber);
System.out.println(binaryString);
}
}
Leave a Comment
Cancel reply