public void addBlock(String which)
{
content[height] = which;
height = height + 1;
}
Remark. The idea is to store the block's label into the content array and add 1 to height, indicating that there is one more block in the stack.
The content array has cells content[0], content[1], content[2], ... where strings can be put. The first block goes in content[0], the second block goes in content[1], etc. So, in general, the k-th block goes in content[k-1]. It is important to write
content[height] = which;
height = height + 1;
not
height = height + 1;
content[height] = which;