Why use 1<<4 instead of 16?

Viewed 5475

The OpenJDK code for java.util.HashMap includes the following line:

static final int DEFAULT_INITIAL_CAPACITY = 1 << 4; // aka 16

Why is 1 << 4 used here, and not 16? I'm curious.

3 Answers
Related