I know that Strings/literals are optimized - they are stored in NoHeap PermanentGeneration - Interned Strings, so if you create two same literals, they would point to the same address in memory.
Interned Strings (String Table) The Java Language Specification requires that identical string literals, that contain the same sequence of Unicode code points, must refer to the same instance of String. In addition if String.intern() is called on an instance of String a reference must be returned that would be identical to the reference return if the string was a literal. The following therefore holds true: ("j" + "v" + "m").intern() == "jvm"
What about other types - are they stored in some JVM area? I heard that Integers are cached somehow - but in JVM or in a static manner inside Integer class? Are all Integers are cached - from Integer.min_value to max_value? Are simple types like int are also cached? What about other types like BigDecimal, Long, char etc?
Are big types like Long, Integer cached in the same place as long and int? JVM or where?