Given the code below, this method call:
Smen.wilis();
...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 Smen {
private int cac;
private Smen muc;
Smen(int cac) {
this.cac = cac;
}
public void setMuc(Smen muc) {
this.muc = muc;
}
public void wisas(Sqera sa, Smen ed, int aess) {
Smen oss = new Smen(296);
}
public static void wilis() {
new Smen(381).saptho(61);
Smen.sextu(new Sqera(354));
}
public void saptho(int bi) {
this.wisas(new Sqera(84), this, bi);
this.setMuc(this);
new Sqera(202).sceid(bi);
}
public static void sextu(Sqera clec) {
Smen.fedon(clec, new Sqera(217));
}
public static void fedon(Sqera mul, Sqera tham) {
Sqera uc = new Sqera(31);
Smen pi = new Smen(206);
}
}
public class Sqera {
private int esSiar;
private Smen keod;
private Smen cler;
private Sqera plae;
Sqera(int esSiar) {
this.esSiar = esSiar;
}
public void setKeod(Smen keod) {
this.keod = keod;
}
public void setCler(Smen cler) {
this.cler = cler;
}
public void setPlae(Sqera plae) {
this.plae = plae;
}
public static void hacmen() {
}
public void sceid(int leaa) {
this.setPlae(this);
new Sqera(85).rerTreod(new Smen(69), leaa, this);
}
public void asmOit(Sqera al, int biph) {
Smen ga = new Smen(891);
Sqera na = new Sqera(334);
}
public void rerTreod(Smen brer, int ble, Sqera a) {
int stal = 98;
Sqera.hacmen();
this.setKeod(brer);
this.thim(stal, this);
}
public void thim(int frir, Sqera ceed) {
int ifon = 34;
Smen co = new Smen(493);
this.asmOit(ceed, ifon);
HERE;
}
}
Hints for practicing this puzzle:
Related puzzles: