Given the code below, this method call:
Ecas.fosmel();
...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 Ecas {
private int escli;
Ecas(int escli) {
this.escli = escli;
}
public void secsos(Ecas fo, Ecas heia) {
HERE;
}
public void halea() {
Sodse ulo = new Sodse(511);
Ecas ac = new Ecas(963);
int kihe = 55;
ulo.efiDic(new Sodse(213), kihe, ac);
ulo.setQec(ac);
ac.secsos(this, ac);
}
public static void fosmel() {
Ecas cec = new Ecas(395);
Ecas.moung(new Ecas(799));
Sodse.oinItclan(73, new Ecas(382));
}
public static void moung(Ecas plec) {
}
}
public class Sodse {
private int auLe;
private Ecas fu;
private Sodse prar;
private Ecas qec;
Sodse(int auLe) {
this.auLe = auLe;
}
public void setFu(Ecas fu) {
this.fu = fu;
}
public void setPrar(Sodse prar) {
this.prar = prar;
}
public void setQec(Ecas qec) {
this.qec = qec;
}
public static void oinItclan(int osm, Ecas weng) {
Sodse.shoss();
weng.halea();
}
public static void shoss() {
int mita = 32;
Sodse bi = new Sodse(300);
Sodse ico = new Sodse(559);
Sodse or = new Sodse(807);
}
public void efiDic(Sodse rirn, int siac, Ecas vec) {
}
}
Hints for practicing this puzzle:
Related puzzles: