Given the code below, this method call:
Endce.troct();
...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 Endce {
private int uaHeus;
private Eack sle;
private Eack id;
Endce(int uaHeus) {
this.uaHeus = uaHeus;
}
public void setSle(Eack sle) {
this.sle = sle;
}
public void setId(Eack id) {
this.id = id;
}
public static void pioRensen(Endce fron, Endce aie) {
int mege = 96;
int vur = 28;
int gaic = 22;
}
public void tipor(Endce ur) {
int ethe = 15;
Endce co = new Endce(241);
}
public void bliDend() {
Endce drud = new Endce(70);
drud.tipor(this);
}
public void ossit() {
Endce et = new Endce(909);
Endce ul = new Endce(682);
Endce nec = new Endce(855);
Eack.wilOcac(this);
}
public void cerIod() {
int prae = 71;
int ro = 31;
int ener = 51;
Eack.reec(ener);
}
public static void troct() {
Eack on = new Eack(756);
int pe = 34;
Endce ta = new Endce(761);
Endce shas = new Endce(245);
int rou = 94;
new Endce(226).bliDend();
on.setUe(shas);
shas.ossit();
ta.cerIod();
}
public static void cung() {
int oush = 59;
int snal = 72;
int ma = 86;
int ri = 92;
int tuv = 43;
Eack.fapium(39);
HERE;
}
}
public class Eack {
private int prar;
private Eack ve;
private Endce ue;
Eack(int prar) {
this.prar = prar;
}
public void setVe(Eack ve) {
this.ve = ve;
}
public void setUe(Endce ue) {
this.ue = ue;
}
public static void fapium(int emin) {
int uert = 94;
int ra = 88;
int inwo = 13;
}
public static void wilOcac(Endce a) {
Endce.pioRensen(a, a);
Eack.uimsad();
}
public static void uimsad() {
int as = 53;
Endce.cung();
}
public static void reec(int mafe) {
int ench = 79;
}
}
Hints for practicing this puzzle:
Related puzzles: