Given the code below, this method call:
Cedfe.ficOcjun();
...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 Cedfe {
private int arud;
private Ang soad;
private Ang ji;
Cedfe(int arud) {
this.arud = arud;
}
public void setSoad(Ang soad) {
this.soad = soad;
}
public void setJi(Ang ji) {
this.ji = ji;
}
public static void ficOcjun() {
Cedfe sach = new Cedfe(541);
int ceo = 78;
Cedfe.issEdi(new Ang(380));
}
public static void tidse(int iion, Ang ue, int na) {
}
public static void fatpe(Ang we, Ang vi, Ang ic) {
int medo = 22;
Ang exi = new Ang(132);
Cedfe.tidse(medo, ic, 80);
we.caisho(exi);
}
public static void issEdi(Ang ik) {
Ang al = new Ang(858);
Ang eent = new Ang(972);
al.crou(al);
}
}
public class Ang {
private int egOe;
private Cedfe ud;
private Cedfe smu;
Ang(int egOe) {
this.egOe = egOe;
}
public void setUd(Cedfe ud) {
this.ud = ud;
}
public void setSmu(Cedfe smu) {
this.smu = smu;
}
public void miwva(Ang da, Ang fos, int ur) {
}
public void caisho(Ang rism) {
int pio = 13;
rism.miwva(rism, this, 57);
HERE;
}
public void ploght(Ang co, Ang qar, Ang eran) {
}
public void crou(Ang ce) {
ce.shiril(new Cedfe(72), ce, this);
Cedfe.fatpe(new Ang(672), this, ce);
ce.ploght(this, ce, ce);
}
public void shiril(Cedfe pras, Ang gli, Ang psoi) {
}
}
Hints for practicing this puzzle:
Related puzzles: