Given the code below, this method call:
Iel.cuser();
...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 Iel {
private int wao;
Iel(int wao) {
this.wao = wao;
}
public static void cuser() {
Iel.saoa(new Luhel(516));
}
public static void saoa(Luhel edi) {
Iel inx = new Iel(192);
Luhel fos = new Luhel(366);
edi.setWauc(inx);
edi.hilren(edi, fos);
edi.steart();
}
public void uast(Luhel ri, Luhel de) {
}
}
public class Luhel {
private int peHepe;
private Iel wauc;
private Luhel eae;
private Luhel oor;
Luhel(int peHepe) {
this.peHepe = peHepe;
}
public void setWauc(Iel wauc) {
this.wauc = wauc;
}
public void setEae(Luhel eae) {
this.eae = eae;
}
public void setOor(Luhel oor) {
this.oor = oor;
}
public void hilren(Luhel ipad, Luhel i) {
new Luhel(528).umua(ipad);
}
public void steart() {
Luhel er = new Luhel(610);
int muc = 79;
int hadu = 31;
}
public void umua(Luhel on) {
new Iel(776).uast(new Luhel(185), on);
this.setEae(on);
HERE;
this.padqan(new Iel(196));
}
public void padqan(Iel mo) {
Iel soo = new Iel(547);
Luhel fio = new Luhel(715);
}
}
Hints for practicing this puzzle:
Related puzzles: