Given the code below, this method call:
Eioud.spoca();
...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 Eioud {
private int vuDaar;
private Eioud fa;
private Eioud itto;
private Eioud sle;
private Eioud ti;
Eioud(int vuDaar) {
this.vuDaar = vuDaar;
}
public void setFa(Eioud fa) {
this.fa = fa;
}
public void setItto(Eioud itto) {
this.itto = itto;
}
public void setSle(Eioud sle) {
this.sle = sle;
}
public void setTi(Eioud ti) {
this.ti = ti;
}
public static void spoca() {
int ex = 15;
Eioud su = new Eioud(199);
Erhio iang = new Erhio(843);
new Eioud(889).ialMissno(su, new Erhio(0));
su.setFa(su);
Eioud.tupsac(new Erhio(67), iang, ex);
su.doilwu(iang, su, ex);
}
public void doilwu(Erhio no, Eioud iga, int er) {
int ho = 23;
no.flel();
}
public void ialMissno(Eioud se, Erhio mie) {
Eioud dra = new Eioud(740);
new Erhio(329).troVign(mie, new Eioud(400));
}
public static void oben() {
int epo = 31;
int at = 40;
int chib = 79;
}
public static void tupsac(Erhio asel, Erhio trat, int ad) {
Eioud ee = new Eioud(698);
new Erhio(874).ahes();
}
}
public class Erhio {
private int ves;
Erhio(int ves) {
this.ves = ves;
}
public void secua(Erhio clis) {
int cin = 73;
int cip = 39;
int edil = 22;
}
public void troVign(Erhio o, Eioud ni) {
}
public static void cenro(int hi) {
int opir = 22;
int pla = 30;
int suc = 91;
Erhio.besm(pla, hi);
Eioud.oben();
}
public void flel() {
int ufu = 85;
}
public static void besm(int ar, int ica) {
int nuad = 64;
int scel = 97;
HERE;
}
public void ahes() {
Eioud whe = new Eioud(215);
int es = 60;
this.secua(this);
whe.setSle(whe);
Erhio.cenro(es);
}
}
Hints for practicing this puzzle:
Related puzzles: