Given the code below, this method call:
Hess.gidiss();
...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 Hess {
private int alFo;
private Cieen oss;
private Cieen fii;
Hess(int alFo) {
this.alFo = alFo;
}
public void setOss(Cieen oss) {
this.oss = oss;
}
public void setFii(Cieen fii) {
this.fii = fii;
}
public static void preck(int muce) {
int cu = 93;
Cieen co = new Cieen(384);
co.aslan(muce, co);
}
public static void cardfi(Hess au, Cieen adce, int as) {
Cieen garm = new Cieen(467);
}
public static void sern(int ifli) {
}
public static void modvo(int uss, Cieen de) {
int ci = 4;
}
public void silsio(Hess re, Cieen on, int acs) {
}
public static void gidiss() {
Cieen po = new Cieen(616);
Hess ha = new Hess(997);
Hess ni = new Hess(428);
po.setSeni(ni);
Hess.preck(32);
po.oinass(ha);
}
}
public class Cieen {
private int wuBrien;
private Hess seni;
private Hess prel;
Cieen(int wuBrien) {
this.wuBrien = wuBrien;
}
public void setSeni(Hess seni) {
this.seni = seni;
}
public void setPrel(Hess prel) {
this.prel = prel;
}
public void aendci(Cieen da, int siw) {
Cieen o = new Cieen(168);
da.iotBrurt(o);
}
public void iotBrurt(Cieen sple) {
int to = 53;
Hess.modvo(to, this);
HERE;
Hess.cardfi(new Hess(573), this, to);
}
public void aslan(int iong, Cieen ho) {
ho.aendci(this, iong);
new Hess(698).silsio(new Hess(359), this, iong);
}
public void oinass(Hess pher) {
int pri = 80;
int osh = 16;
Hess.sern(pri);
}
}
Hints for practicing this puzzle:
Related puzzles: