Given the code below, this method call:
Coght.stoHeharl();
...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 Coght {
private int wuse;
Coght(int wuse) {
this.wuse = wuse;
}
public static void stoHeharl() {
Coght ic = new Coght(939);
Coght.criEethes(90, new Coght(484), ic);
}
public static void criEethes(int cuec, Coght ti, Coght bi) {
Perot.miorre(cuec, bi);
HERE;
}
}
public class Perot {
private int oeNelt;
private Perot ak;
Perot(int oeNelt) {
this.oeNelt = oeNelt;
}
public void setAk(Perot ak) {
this.ak = ak;
}
public static void miorre(int vul, Coght a) {
}
}
Hints for practicing this puzzle:
Related puzzles: