Given the code below, this method call:
Cel.imeor();
...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 Cel {
private int eiBaf;
private Cel saol;
private Cel de;
private Beac ik;
private Beac es;
Cel(int eiBaf) {
this.eiBaf = eiBaf;
}
public void setSaol(Cel saol) {
this.saol = saol;
}
public void setDe(Cel de) {
this.de = de;
}
public void setIk(Beac ik) {
this.ik = ik;
}
public void setEs(Beac es) {
this.es = es;
}
public void cedpe(Cel he, Cel siad, Cel om) {
}
public static void adgi(int ir, int vid) {
int kess = 84;
int bli = 49;
}
public static void imeor() {
Cel ec = new Cel(192);
Cel ot = new Cel(435);
Beac tith = new Beac(739);
Cel sast = new Cel(267);
Cel so = new Cel(320);
sast.setIk(tith);
so.presh();
}
public static void ciand(int kiwa, Beac a) {
int bi = 13;
int gi = 66;
}
public void presh() {
new Cel(631).cedpe(this, new Cel(947), new Cel(218));
this.setDe(this);
new Beac(766).psua();
}
}
public class Beac {
private int nua;
Beac(int nua) {
this.nua = nua;
}
public static void sadphu(int adu, Beac cio) {
cio.piawu(adu, cio);
cio.viori();
}
public void viori() {
int psak = 39;
int mo = 87;
int le = 67;
HERE;
Cel.adgi(mo, psak);
}
public void piawu(int shix, Beac bre) {
int ighe = 84;
}
public void psua() {
int moti = 9;
int io = 43;
Beac.sadphu(moti, this);
Cel.ciand(io, this);
}
}
Hints for practicing this puzzle:
Related puzzles: