What happens when I create a reference to an object inside a thread?
I recently started to learn Java programming and we just reach the Java Threads topic.
What I'm trying to understand is, lets say I have a Thread object which creates an instance of "Object cat" inside its run() method, as far as I learned (you are more than welcome to correct me if I'm wrong) the reference variable "cat" should be held in the heap (making it visible for all the "living" threads). However what I'm trying to understand is what kind of data is stored on the the thread's "private" stack w.r.t this "Object cat". 10x in advance.
What happens when I create a reference to an object inside a thread?
===

I recently started to learn Java programming and we just reach the Java Threads topic.
What I'm trying to understand is, lets say I have a Thread object which creates an instance of "Object cat" inside its run() method, as far as I learned (you are more than welcome to correct me if I'm wrong) the reference variable "cat" should be held in the heap (making it visible for all the "living" threads). However what I'm trying to understand is what kind of data is stored on the the thread's "private" stack w.r.t this "Object cat". 10x in advance.