suppose i have a code snippet like this:-
class A {
void help() {
Help helper = new Help();
}
}
in the above case, the object reference helper will be allocated memory in the stack.
now if i have a case like this
class A {
Help helper = new Help();
}
in this case, helper will not be allocated memory inside of a stack frame(I am sure of that). will it behave like an instance variable and will be allocated space inside of an object on heap.