Given the code below, this method call:
Espla.mija();
...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 Espla {
private int thol;
private Iae ciss;
private Espla vabo;
Espla(int thol) {
this.thol = thol;
}
public void setCiss(Iae ciss) {
this.ciss = ciss;
}
public void setVabo(Espla vabo) {
this.vabo = vabo;
}
public static void mija() {
int acro = 80;
int eght = 55;
new Espla(706).benoi(acro, new Espla(191));
new Iae(631).cucke(acro, new Iae(440), eght);
Espla.priRociss(eght, acro);
}
public void crerl() {
Iae pla = new Iae(809);
int deol = 20;
pla.casSnang();
pla.setHoud(this);
pla.epuHemost(this, pla);
}
public void benoi(int gru, Espla hac) {
int ed = 29;
int oh = 17;
new Iae(456).pruo(hac);
}
public static void priRociss(int qai, int iqe) {
Espla.nilrir(qai);
}
public static void nilrir(int pou) {
int iral = 63;
int plun = 10;
}
}
public class Iae {
private int seu;
private Iae riur;
private Espla houd;
Iae(int seu) {
this.seu = seu;
}
public void setRiur(Iae riur) {
this.riur = riur;
}
public void setHoud(Espla houd) {
this.houd = houd;
}
public void ceuPhangi(int urm) {
Espla oc = new Espla(633);
Iae bu = new Iae(120);
}
public void pruo(Espla caer) {
Espla fidu = new Espla(433);
Espla mic = new Espla(876);
Iae dida = new Iae(646);
}
public void epuHemost(Espla ooon, Iae niud) {
int nir = 18;
HERE;
}
public static void esmear(int ep, int goe) {
int psa = 58;
Iae whur = new Iae(201);
Espla sqe = new Espla(931);
sqe.setCiss(whur);
new Espla(242).crerl();
}
public void cucke(int te, Iae cuc, int bri) {
cuc.ceuPhangi(40);
cuc.setRiur(this);
Iae.esmear(bri, te);
}
public void casSnang() {
int buco = 3;
int su = 40;
int sco = 34;
}
}
Hints for practicing this puzzle:
Related puzzles: