Question: So, we have a HashMap, and a transient Entry[] table inside it. In many methods, for example, in clear(), we copy table:

```
public void clear() {
    modCount++;
    Entry[] tab = table;
    for (int i = 0; i < tab.length; i++)
        tab[i] = null;
    size = 0;
}

```

But why we do Entry[] tab = table? What's wrong in next code?

```
public void clear() {
    modCount++;
    for (int i = 0; i < table.length; i++)
        table[i] = null;
    size = 0;
}

```

As far as i know, tab is only a reference to table, and, for at first sight, is just a wasting of space.

Answer: 
```
 for (int i = 0; i < table.length; i++)
        tab[i] = null;

```

You are right, `tab` and `table` both point to the same object. The problem I see is using table in the for-conditional and tab in the for-body. You should use one or the other, but not both. 

`tab` is unnecessary, but sometimes people do this for readability reasons. Doesn't make sense here, since table is more readable. If I were code reviewing this, I would strongly prefer the second version.
It's just one locally scoped object reference. Not a lot of space there.