Given the code below, this method call:
Hoir.flusm();
...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 Hoir {
private int gaIod;
private Ede da;
private Ede vi;
Hoir(int gaIod) {
this.gaIod = gaIod;
}
public void setDa(Ede da) {
this.da = da;
}
public void setVi(Ede vi) {
this.vi = vi;
}
public static void crac(int hi, int de, Ede joc) {
int ed = 86;
int hism = 8;
}
public static void mait() {
Ede sper = new Ede(669);
int ulme = 14;
Ede iol = new Ede(526);
sper.setHo(iol);
iol.kimhi(ulme);
}
public static void flusm() {
Hoir ti = new Hoir(923);
int pec = 87;
Ede.nague();
}
public void orpons() {
int sqe = 16;
int re = 81;
int isme = 65;
}
}
public class Ede {
private int resod;
private Ede ho;
private Hoir al;
Ede(int resod) {
this.resod = resod;
}
public void setHo(Ede ho) {
this.ho = ho;
}
public void setAl(Hoir al) {
this.al = al;
}
public void kimhi(int an) {
Ede ba = new Ede(548);
ba.setHo(this);
new Ede(580).pritwe(new Hoir(752), this, an);
ba.dingce(ba, this, an);
}
public static void nague() {
Ede.peca(new Ede(290), new Hoir(374), new Ede(755));
Hoir.mait();
}
public void pritwe(Hoir il, Ede io, int pi) {
int nu = 20;
Hoir.crac(pi, nu, io);
il.setVi(io);
HERE;
il.orpons();
}
public void dingce(Ede miap, Ede li, int rir) {
int o = 94;
}
public static void peca(Ede va, Hoir ee, Ede prol) {
}
}
Hints for practicing this puzzle:
Related puzzles: