Originally posted by Jesper Young:
Objects are always on the heap.
Last time I said this, I seem to remember Jim or Earnest telling me this was no longer true. In Java 6, apparently, the JVM is smart enough to realise some objects are used only locally within a particular method, and sticks them on the stack.
Even assuming this is true, it's a JVM internal implementation detail, of academic interest only. From the point of view of the Java programmer, all objects still behave as if they were on the heap.