Where do java interfaces reside in memory? Do they reside in the heap or the stack, or maybe global memory? I am thinking the are in the stack since they are created at compile time. Am I correct?
Class definitions -- including interfaces and abstract classes -- are held in PermGen space, meaning they are never garbage collected. The PermGen is, iirc, a part of the heap.
Class definitions (including interfaces, etc) are stored on the heap (usually in the Permanent generation because their lifetime is long). If the ClassLoader
that created them is garbage collected, they too are then eligible for garbage collection.
Interfaces are technically not "instantiated" in the sense that a regular class instance is created, but class information is stored in the java permgen space. See http://blogs.sun.com/jonthecollector/entry/presenting_the_permanent_generation for more information on the permgen and the difference between a class instance and class information.