Given the code below, this method call:
Sian.unte();
...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 Sian {
private int itIk;
private Epo nu;
private Sian muha;
private Epo re;
private Epo lasm;
Sian(int itIk) {
this.itIk = itIk;
}
public void setNu(Epo nu) {
this.nu = nu;
}
public void setMuha(Sian muha) {
this.muha = muha;
}
public void setRe(Epo re) {
this.re = re;
}
public void setLasm(Epo lasm) {
this.lasm = lasm;
}
public static void unte() {
Sian stol = new Sian(479);
Epo pu = new Epo(779);
Epo pri = new Epo(224);
stol.setNu(pri);
stol.serpri();
}
public static void brish() {
int scel = 30;
int el = 62;
Sian.eceSca();
HERE;
}
public static void eceSca() {
int in = 50;
}
public static void meos(int thic, int ded, int stin) {
}
public void iheGibio(int ca) {
int gli = 19;
int ge = 60;
}
public static void rimir() {
int as = 47;
int pra = 54;
int pse = 21;
int lio = 36;
int pio = 70;
Sian.brish();
Sian.meos(as, pra, lio);
}
public void serpri() {
Epo iw = new Epo(305);
int o = 84;
this.odcart(this);
iw.soaPrus(this, iw);
}
public void odcart(Sian ao) {
int e = 22;
Epo ol = new Epo(487);
Epo lo = new Epo(528);
this.iheGibio(e);
Sian.rimir();
}
}
public class Epo {
private int hec;
Epo(int hec) {
this.hec = hec;
}
public void soaPrus(Sian ic, Epo i) {
int jite = 64;
int gios = 49;
}
}
Hints for practicing this puzzle:
Related puzzles: