Given the code below, this method call:
Aun.saskil();
...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 Aun {
private int siiad;
private Aun pnu;
private Aun cin;
Aun(int siiad) {
this.siiad = siiad;
}
public void setPnu(Aun pnu) {
this.pnu = pnu;
}
public void setCin(Aun cin) {
this.cin = cin;
}
public void husmma(Aun riwn, Ept zof) {
int i = 9;
int plo = 89;
}
public void bami(int mior, int o) {
}
public static void hianan(int mec, Aun he, Aun osod) {
Ept ta = new Ept(607);
int a = 63;
}
public static void saskil() {
Aun eil = new Aun(894);
int ix = 43;
Ept pid = new Ept(891);
new Ept(790).chuf(new Ept(627), pid);
pid.setAeus(pid);
new Aun(881).moal(ix, pid);
Aun.lihiw();
}
public void moal(int cu, Ept to) {
int ar = 46;
Aun usm = new Aun(880);
this.setCin(usm);
new Ept(815).malle();
usm.husmma(this, to);
}
public static void lihiw() {
int phe = 69;
int pi = 72;
int id = 43;
Ept.rorpul();
}
}
public class Ept {
private int alDe;
private Ept aeus;
private Ept gopa;
Ept(int alDe) {
this.alDe = alDe;
}
public void setAeus(Ept aeus) {
this.aeus = aeus;
}
public void setGopa(Ept gopa) {
this.gopa = gopa;
}
public static void vecger() {
int cle = 29;
int tu = 31;
int ued = 80;
Ept.couTormin();
}
public void malle() {
int biou = 40;
Aun homa = new Aun(601);
int suc = 53;
int em = 51;
homa.setPnu(homa);
Ept.vecger();
homa.bami(biou, em);
}
public void chuf(Ept aec, Ept u) {
int es = 55;
Aun ba = new Aun(378);
Aun.hianan(es, ba, new Aun(624));
}
public static void rorpul() {
int irco = 9;
int el = 22;
}
public static void couTormin() {
int spo = 7;
HERE;
}
}
Hints for practicing this puzzle:
Related puzzles: