I want to find the most significant bit that is set to 1. I have tried every possible way from & to ORing all of the bits from 1 t
1
&
Just use numberOfTrailingZeros(value) method of Long or Integer class.