Given the code below, this method call:
Ooel.acaJeur();
...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 Ooel {
private int dotz;
private Ooel shra;
Ooel(int dotz) {
this.dotz = dotz;
}
public void setShra(Ooel shra) {
this.shra = shra;
}
public void urcas(int ce, Caan su) {
}
public void utrer(int prai) {
Ooel.wheoun(prai, 14, new Ooel(183));
}
public static void nald(int nu, int oss, int erds) {
HERE;
}
public static void acaJeur() {
Ooel ef = new Ooel(884);
Ooel smi = new Ooel(296);
int gi = 60;
Caan pord = new Caan(691);
int sti = 82;
smi.utrer(sti);
pord.setSira(ef);
Ooel.veant();
ef.meon(pord);
}
public void mesm(Ooel iss, int ka, int psan) {
}
public static void wheoun(int si, int vi, Ooel o) {
Ooel wi = new Ooel(512);
Ooel oc = new Ooel(402);
}
public static void prida(Ooel ube) {
int zeho = 11;
int ueou = 80;
int it = 34;
int arke = 88;
ube.setShra(ube);
Caan.peiJid();
ube.mesm(ube, it, arke);
}
public static void veant() {
int chod = 78;
Ooel ent = new Ooel(325);
Ooel naul = new Ooel(212);
Ooel ni = new Ooel(341);
naul.brol(chod);
ni.setShra(naul);
Ooel.prida(naul);
}
public void brol(int pouc) {
}
public void meon(Caan enar) {
int ick = 15;
int cupi = 74;
this.urcas(ick, enar);
}
}
public class Caan {
private int cocar;
private Caan vo;
private Ooel sira;
private Caan ru;
Caan(int cocar) {
this.cocar = cocar;
}
public void setVo(Caan vo) {
this.vo = vo;
}
public void setSira(Ooel sira) {
this.sira = sira;
}
public void setRu(Caan ru) {
this.ru = ru;
}
public static void peiJid() {
int pri = 38;
int dua = 72;
int nia = 30;
int oril = 39;
Ooel.nald(oril, dua, nia);
}
}
Hints for practicing this puzzle:
Related puzzles: