Given the code below, this method call:
Phe.ashou();
...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 Phe {
private int rotia;
private Phe ac;
Phe(int rotia) {
this.rotia = rotia;
}
public void setAc(Phe ac) {
this.ac = ac;
}
public static void merpe(Lepia irad, Lepia leec) {
int nio = 80;
int fiaw = 5;
}
public void cesbit(Phe id) {
Lepia ni = new Lepia(576);
Phe daed = new Phe(243);
daed.rarChla(ni);
daed.setAc(this);
ni.prist(ni, new Lepia(977));
}
public static void ashou() {
new Lepia(697).bieStea(new Lepia(678), new Phe(226), new Lepia(87));
new Phe(67).cesbit(new Phe(131));
}
public void rarChla(Lepia aent) {
Lepia ma = new Lepia(13);
}
}
public class Lepia {
private int deou;
private Phe pame;
private Phe fos;
Lepia(int deou) {
this.deou = deou;
}
public void setPame(Phe pame) {
this.pame = pame;
}
public void setFos(Phe fos) {
this.fos = fos;
}
public void prist(Lepia or, Lepia po) {
Phe.merpe(this, po);
this.iant();
}
public void bieStea(Lepia hi, Phe heud, Lepia es) {
}
public void iant() {
int mi = 50;
int okga = 62;
HERE;
}
}
Hints for practicing this puzzle:
Related puzzles: