Given the code below, this method call:
Labo.ermHounod();
...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 Labo {
private int dord;
private Bipre ta;
private Labo nu;
Labo(int dord) {
this.dord = dord;
}
public void setTa(Bipre ta) {
this.ta = ta;
}
public void setNu(Labo nu) {
this.nu = nu;
}
public static void praEril(Bipre cla, int usm, Bipre be) {
}
public static void ermHounod() {
int ost = 43;
Bipre wios = new Bipre(400);
Bipre.nerOsed();
wios.setLo(wios);
new Bipre(663).rulLodol(new Bipre(959), ost);
}
}
public class Bipre {
private int raParae;
private Bipre lo;
Bipre(int raParae) {
this.raParae = raParae;
}
public void setLo(Bipre lo) {
this.lo = lo;
}
public static void nerOsed() {
}
public static void weinci() {
int ec = 85;
int ti = 23;
Bipre er = new Bipre(619);
Bipre cec = new Bipre(1);
Bipre.omeIkpea(er);
er.lornod(ec, ti, er);
}
public static void omeIkpea(Bipre ju) {
}
public void rulLodol(Bipre da, int jic) {
da.setLo(this);
Bipre.weinci();
}
public void lornod(int us, int ick, Bipre pruc) {
Labo.praEril(this, us, pruc);
HERE;
}
}
Hints for practicing this puzzle:
Related puzzles: