Given the code below, this method call:
Rumo.hiouw();
...will eventually reach the point marked HERE. Draw a diagram of the stack and the heap at that point.
(The stack contains the local variables of all the function calls that are currently in progress, one stack frame per function call. The heap contains all of the objects that currently exist.)
In your diagram:
this parameter if present. (You do not need to write the types of any variables.)The code:
public class Rumo {
private int eou;
Rumo(int eou) {
this.eou = eou;
}
public void trulas(Mios o) {
}
public static void hiouw() {
Mios jol = new Mios(739);
Rumo ne = new Rumo(340);
jol.setVed(ne);
jol.eshess();
}
}
public class Mios {
private int utid;
private Rumo ved;
Mios(int utid) {
this.utid = utid;
}
public void setVed(Rumo ved) {
this.ved = ved;
}
public void eshess() {
Rumo iss = new Rumo(996);
iss.trulas(this);
HERE;
}
}
Hints for practicing this puzzle:
Related puzzles: