Online Java Compiler By
JavaTpoint.com
public class IntegerNumberOfLeadingZerosExample4 { public static void main(String[] args) { int num = -15; System.out.print("Input Number = " + num); // Returns the number of zero bits preceding the highest leftmost one-bit System.out.print("\nNumber of Leading Zeros = "+Integer.numberOfLeadingZeros(num)); } }
Output