When is a heap used in Java?

Technical