Online Java Compiler By
JavaTpoint.com
public class IntegerNumberOfLeadingZerosExample2 { public static void main(String[] args) { int value = 55; //Get the binary equivalent of this Integer value System.out.print("Binary equivalent: "+Integer.toBinaryString(value)); //Print the number of Leading zeros System.out.print("\nNumber of Leading Zeros: "+Integer.numberOfLeadingZeros(value)); } }
Output