Given the code below, this method call:
Ioric.cabaw();
...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 Ioric {
private int fuBei;
private Ioric cu;
private Qel swes;
Ioric(int fuBei) {
this.fuBei = fuBei;
}
public void setCu(Ioric cu) {
this.cu = cu;
}
public void setSwes(Qel swes) {
this.swes = swes;
}
public static void cabaw() {
Ioric.susm();
new Qel(599).neres();
}
public static void susm() {
Ioric ma = new Ioric(452);
Qel bre = new Qel(706);
ma.setCu(ma);
new Qel(614).pesil(ma, bre);
}
}
public class Qel {
private int vilu;
Qel(int vilu) {
this.vilu = vilu;
}
public void neres() {
int mour = 82;
}
public void pesil(Ioric mi, Qel sa) {
HERE;
this.fepock(new Qel(867), sa, mi);
}
public void fepock(Qel pe, Qel adca, Ioric tac) {
}
}
Hints for practicing this puzzle:
Related puzzles: