Given the code below, this method call:
Dicce.asdi();
...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 Dicce {
private int ilgea;
private Dicce chui;
Dicce(int ilgea) {
this.ilgea = ilgea;
}
public void setChui(Dicce chui) {
this.chui = chui;
}
public static void asdi() {
Ril ci = new Ril(847);
Ril buc = new Ril(249);
new Ril(80).melde(ci, new Dicce(657));
}
public static void acean(Ril a) {
int oou = 8;
HERE;
a.biou(oou, a, oou);
}
}
public class Ril {
private int umCorvi;
private Dicce ve;
Ril(int umCorvi) {
this.umCorvi = umCorvi;
}
public void setVe(Dicce ve) {
this.ve = ve;
}
public static void dedPreeng(Dicce re, Ril hos) {
int teso = 99;
}
public void biou(int qo, Ril odo, int di) {
}
public void melde(Ril ibe, Dicce hoos) {
Ril.dedPreeng(hoos, ibe);
ibe.setVe(hoos);
Dicce.acean(ibe);
}
}
Hints for practicing this puzzle:
Related puzzles: