If I pass in a String literal as an argument, I assume that the String literal is made in the String pool right as a String object? Does this this mean that the literal is somewhere in the heap without a reference of course? And once the method is done executing would the String in the pool be gone?
The same question I would like to ask for primitive type literal values, are they just put on the stack when the method is executed and then they are removed from the stack once the method is done executing?