As I was going through the ConcurrentHashMap source code, I have encountered so many bit wise shift operator. Some are applied on to create constants and some are on variables.
static final int MAXIMUM_CAPACITY = 1 << 30;
static final int MAX_SEGMENTS = 1 << 16; // slightly conservative
long u = (((h >>> segmentShift) & segmentMask) << SSHIFT) + SBASE;
I am not able to understand, if constant like MAXIMUM_CAPACITY could be declared directly then what is the use of using bitwise shift operator.