What happens to the methods inside the objects of the heap?
So I have been reading about stack and heap memory management.
- Methods and variables(inside methods) are stored in the stack.
- Objects and Instance variables are stored inside the heap.
- When an object is called inside a stack method it has a pointer to the heap object.
I would assume these methods are stored on the stack, because 'methods are stored on the stack'. But I am unable to find confirmation about this. What happens to for example the constructor?
Articles or tutorial video's I have seen only give examples of methods in the main class.
Anyone able to answer this question?