java - stack and heap diagram of method that is assigned to reference variable -


how draw stack , heap diagram of following code:

ball b1; ball b2 = new ball(); ball b3 = new ball(); b1= dothing(); b3 = dothings(); 

i know call methed (e.g dothing()) in stack. how relate b1 (which in stack dothing()). should create object in heap them?

all java-ojbect created in heap. if dothing() instantiate ball should create object in heap them on diagram.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -