I am currently learning the memory concepts of java, the stack and the heap, I know that local variables and method calls lived in a place called stack. and objects lived inside a heap. but what if that local variable holds an object? or has an object reference?
public void Something(){
Duck d = new Duck(24);
}
Does it still live inside a stack? and where do instance variables live? please keep it simple as possible. thank you.